急,在線求指導 - TradeBlazer公式 [開拓者 TB]
- 咨詢內容:
Vars
Numeric N;
Numeric M;
Numeric Count;
NumericSeries AvgLine;
Bool Buyday (False);
Bool Sellday(False);
Begin
for N = 1 to 20
{
AvgLine(N-1) = Average(Close,N);
}
M ==0;
Count ==0;
while (M <=19)
{if (AvgLine(M)>AvgLine[M][1])
{
Count=Count+5;
}else
{
Count=Count;
M=M+1;
}
}
if (marketposition[1]==0 and Count>60) buy(1,high+0.2);
if (marketposition[1]==0 and Count<15) sellshort(1,low-0.2) ;
if (marketposition[1]==1 and Count<55) sell(1,low-0.2);
if (marketposition[1]==-1 and Count>25) buytocover(1,high+0.2);
End
求指導哪里出錯了。一直提示的是
for N = 1 to 20
{
AvgLine(N-1) = Average(Close,N);
}
缺少分號 - TB技術人員:
回復 1# greywu
AvgLine(N-1) = Average(Close,N);
這里不能這么寫,Average(Close,N)只能賦值給變量,不能賦值給函數 - TB客服:
回復 2# lh948
那請問該如何修改呢?新手,見諒 - 網友回復:
Vars
Numeric M;
Numeric Count;
Bool Buyday (False);
Bool Sellday(False);
Begin
M ==0;
Count ==0;
while (M <=19)
{if (Average(Close,M+1))>Average(Close,M+2))
{
Count=Count+5;
}else
{
Count=Count;
M=M+1;
}
}
if (marketposition[1]==0 and Count>60) buy(1,high+0.2);
if (marketposition[1]==0 and Count<15) sellshort(1,low-0.2) ;
if (marketposition[1]==1 and Count<55) sell(1,low-0.2);
if (marketposition[1]==-1 and Count>25) buytocover(1,high+0.2);
End - 網友回復:
回復 4# zzzlondon
謝謝了,但是你那個if語句提示說無法識別呢。。
相關文章
-
沒有相關內容