編譯一個止損策略,一下子出現4、5種error,請問怎么破?程序如下 [開拓者 TB]
- 咨詢內容:
Params
Numeric Length(20);
Numeric Offset(2);
Numeric type(0); //調用期貨的品種0-IF,1-Rb
Numeric Timeframe(1440); //調用數據的時間周期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); //止盈啟動開關
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
編譯的時候出現error C2143 C2059 C4430 C2065 我勒個去,傻眼了,求各位大俠指點迷津 - TB技術人員:
data_of_body 應該是個用戶函數吧,你有沒啊
- TB客服:
data_of_body不是系統函數,不能直接用啊!而且程序里也不應該直接用open、close這樣的寫法,否則測試就失真了,這相當于未來函數了。
- 網友回復: 慢慢改
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容