編譯一個止損策略,一下子出現(xiàn)4、5種error,請問怎么破?程序如下 [開拓者 TB]
- 咨詢內(nèi)容:
Params
Numeric Length(20);
Numeric Offset(2);
Numeric type(0); //調(diào)用期貨的品種0-IF,1-Rb
Numeric Timeframe(1440); //調(diào)用數(shù)據(jù)的時間周期30min-30,1hour-60,1day-1440
NumericRef StopLossLine; //止損線
NumericRef StopInterestLine; //止盈線
Vars
Bool CloseOut;
NumericSeries UpLine; //上軌
NumericSeries DownLine; //下軌
NumericSeries MidLine; //中間線
Numeric Band;
Numeric RLine_between_gm;
Numeric RLine_between_ml;
Numeric GLine_between_gm;
Numeric GLine_between_ml;
BoolSeries switch(False); //止盈啟動開關(guān)
NumericSeries stpline;
Begin
MidLine = AverageFC(Close,Length);
Band = StandardDev(Close,Length,2);
UpLine = MidLine + Offset * Band;
DownLine = MidLine - Offset * Band;
data_of_body(type,Timeframe,RLine_between_gm,RLine_between_ml,GLine_between_gm,GLine_between_ml);
IF(MarketPosition==1)
{
StopLossLine=MidLine;
stpline=StopLossLine;
StopInterestLine=Low[1];
IF(!switch And High[1]>UpLine[1])
switch=True;
IF(switch And Low<StopInterestLine)
{
CloseOut=True;
switch=False;
}
Else IF(Close[1]<stpline[1])
CloseOut=True;
Else IF((Open-Close)>GLine_between_gm And Low<StopLossLine)
CloseOut=True;
Else
CloseOut=False;
}
IF(MarketPosition==-1)
{
StopLossLine=MidLine;
stpline=StopLossLine;
StopInterestLine=High[1];
IF(!switch And Low[1]<DownLine[1])
switch=True;
IF(switch And High>StopInterestLine)
{
CloseOut=True;
switch=False;
}
Else IF(Close[1]>stpline[1])
CloseOut=True;
Else IF((Close-Open)>RLine_between_gm And High>StopLossLine)
CloseOut=True;
Else
CloseOut=False;
}
Return CloseOut;
End
編譯的時候出現(xiàn)error C2143 C2059 C4430 C2065 我勒個去,傻眼了,求各位大俠指點迷津 - TB技術(shù)人員:
data_of_body 應(yīng)該是個用戶函數(shù)吧,你有沒啊
- TB客服:
data_of_body不是系統(tǒng)函數(shù),不能直接用啊!而且程序里也不應(yīng)該直接用open、close這樣的寫法,否則測試就失真了,這相當于未來函數(shù)了。
- 網(wǎng)友回復(fù): 慢慢改
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容