- 精华
- 0
- 在线时间
- 4 小时
- UID
- 148688
- 积分
- 2
- 帖子
- 1
- 阅读权限
- 10
- 注册时间
- 2012-10-17
- 最后登录
- 2013-11-11
- 精华
- 0
- UID
- 148688
- 积分
- 2
- 帖子
- 1
- 主题
- 1
- 阅读权限
- 10
- 注册时间
- 2012-10-17
- 最后登录
- 2013-11-11
|
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 我勒个去,傻眼了,求各位大侠指点迷津 |
|