COCO研究院

 找回密碼
 註冊
搜索
查看: 2082|回復: 6

AMI 6.00错误如何修改 请教

[複製鏈接]
發表於 15-10-3 17:38 | 顯示全部樓層 |閱讀模式
升级6.0后 point & figure 程式出现错误,请大大们帮忙啊

_SECTION_BEGIN("New formula 151");
// P&F chart based on closing price
// Date & Bar Number of start & end of columns
// Graham Kavanagh  17 Apr 2004
// Interpretation window data included
// 1:1 Line drawn when column selected with slope=boxsize
// Box size based on ATR of closing price
Version(4.53);
SetBarsRequired(100000,100000);
range = Min(260,BarCount/2);
box = LastValue( round(ATR(range)*100)/100 );
Reverse = 3  ;      // reversal requirement
CX = round(C/box);
CF = ceil(Cx);
CR = floor(Cx);
Bar = BarIndex();
BarDate = DateNum();
BarTurn = 0;
BarEnd = 0;

// initialize first element
j = 0;
PFC[j] = CF[0];
PFO[j] = CF[0]+1;
down = 1;                  // By default the first bar is a down bar.
up = 0;
// perform the loop that produces PF Chart
for( i = 1; i < BarCount; i++ )
{
if( CF[i] <= PFC[j]-1 && down)         //continue down
{
  PFC[j] = CF[i];
  PFO[j] = CF[i]+1;
  BarEnd[j] = Bar[i];
}
else
{
  if( CR[i] >= PFC[j] + Reverse && down)  //Change direction to up
  {
   j++;
   up = 1;
   down = 0;
   PFC[j] = CR[i];
   PFO[j] = CR[i] - 1;
   BarTurn[j] = Bar[i];
   BarEnd[j] = Bar[i];
  }
}
if( CR[i] >= PFC[j] + 1 && up)         //Continue up
{
  PFC[j] = CR[i];
  PFO[j] = CR[i] - 1;
  BarEnd[j] = Bar[i];
}
else
{
  if( CF[i] <= PFC[j] - Reverse && up)   //Change direction to down
  {
   j++;
   up = 0;
   down = 1;
   PFC[j] = CR[i];
   PFO[j] = CR[i]+1;
   BarTurn[j] = Bar[i];
   BarEnd[j] = Bar[i];
  }
}
}
delta = BarCount-1 - j;
BarTurns = Ref( BarTurn, -delta);
BarEnds = Ref( BarEnd, -delta);
PFO = Ref( PFO, -delta );
PFC = Ref( PFC, -delta );
H = IIf( Ref(PFC,-1)>Ref(PFO,-1), Ref(HHV(PFC,1),-1)-1, Max(PFO,PFC) )*box +
box/2;
L = IIf( Ref(PFC,-1)<Ref(PFO,-1), Ref(LLV(PFC,1),-1)+1, Min(PFO,PFC) )*box -
box/2;
O = IIf( Ref(PFC,-1)>Ref(PFO,-1), Ref(HHV(PFC,1),-1)-1, IIf(
Ref(PFc,-1)<Ref(PFO,-1), Ref(LLV(PFC,1),-1)+1, PFO ) )*box;
// the difference between Open AND Close is set to box size
// the sign decides if X or O are plotted
C = O + box * IIf( PFC > PFO, 1, -1 );
top = H - box/10;
bot = L + box/10;

GraphXSpace =5;
//Title = Name() + " " + Now(1) + ": PF System, H: $" + Top + (for today's date)
_N(
Title = Name() + " " + Date() + ": PF System, H: $" + Top + ", L: $" + Bot + ",
Box $" + Box + " Reversal " + Reverse + "\n" + "NewCol bar " + BarTurns + " Date
" + WriteVal(
ValueWhen(BarIndex()==SelectedValue(BarTurns),DateTime()),formatDateTime)  + "
ColEnd bar " + BarEnds + " Date " + WriteVal(
ValueWhen(BarIndex()==SelectedValue(BarEnds),DateTime()),formatDateTime)
  );
Plot(C, "P&F Close", IIf( PFC > PFO, colorBlue, colorRed ), styleCandle +
stylePointAndFigure);

LineUp = LineArray( SelectedValue(BarIndex()), SelectedValue(L),
SelectedValue(BarIndex())+1, SelectedValue(L)+box, 1, 0 );
Linedown = LineArray( SelectedValue(BarIndex()), SelectedValue(H),
SelectedValue(BarIndex())+1, SelectedValue(H)-box, 1, 0 );
Plot(IIf(SelectedValue(PFC<PFO),Lineup,Null), "Line", colorGreen, styleLine +
styleNoLabel + styleNoRescale);
Plot(IIf(SelectedValue(PFC>PFO),Linedown,Null), "Line", colorBrown, styleLine +
styleNoLabel + styleNoRescale);
//--Indicator-End--
Name() +", "+FullName();
"";
"Direction  = " + WriteIf(pfc>pfo,"Up","Down");
"Move Today = " + WriteIf(BarIndex()==SelectedValue(BarEnds),"Yes" +
WriteIf(BarIndex()==SelectedValue(BarTurns),", New Column", ",
Continuation"),"No");
"";
"Column Start \n   BarIndex() = " + BarTurns + "\n   Date() = " + WriteVal(
ValueWhen(BarIndex()==SelectedValue(BarTurns), DateTime()), formatDateTime) ;
"Column End \n   BarIndex() = " + BarEnds + "\n   Date() = " + WriteVal(
ValueWhen(BarIndex()==SelectedValue(BarEnds),DateTime()),formatDateTime)   ;
_SECTION_END();

發表於 15-10-3 21:10 | 顯示全部樓層
出什麼錯誤訊息?
是說升級前用的好好的,升級後才這樣嗎?
 樓主| 發表於 15-10-4 09:23 | 顯示全部樓層
lwhuang 發表於 15-10-3 21:10
出什麼錯誤訊息?
是說升級前用的好好的,升級後才這樣嗎?

是的,升級前用的好好的,升級後才這樣
 樓主| 發表於 15-10-4 09:28 | 顯示全部樓層
升級前用的好好的,出錯誤訊息:
2015-10-4 9-25-00.jpg
發表於 15-10-4 09:40 | 顯示全部樓層
reverse 是function 將它改成其他非保留字試試
 樓主| 發表於 15-10-4 09:46 | 顯示全部樓層
谢谢 我試試
6.00能换回5.9 or 5.8 ?
 樓主| 發表於 15-10-5 10:43 | 顯示全部樓層
换回 5.8 了 谢谢关注
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-28 08:14

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook