参数名:
win1:60
win2:100
win3:120
out1:10
out2:30
out3:20
--------------------------------------------
{ NumericSeries Rulow;//开仓以来最低价
NumericSeries Ruhigh;//开仓以来最高价
Numeric windots1; //赢利点
Numeric outdots1;//出场点
Numeric windots2; //赢利点
Numeric outdots2;//出场点
}
Begin
//开空单
If(holding=0 and Open>close and time<143000) then begin
BUYSHORT(1,1,limitr,close);
END
Rulow=LLV(low,ENTERBARS);//获得开仓以来的最低价
windots1=ENTERPRICE-Rulow;//计算盈利点数
outdots1=close-Rulow;
//盈利离场
If(holding<0 and windots1>win1 and windots1<win2 and outdots1>out1) then begin
SELLSHORT(1,1,limitr,close);
elseif(holding<0 and windots1>win2 and windots1<win3 and outdots1>out2) then begin
SELLSHORT(1,1,limitr,close);
Elseif(holding<0 and windots1>win3) then BEGIN
SELLSHORT(1,1,limitr,close);
end
end
end
//止损离场
if(holding<0 and ((close-ENTERPRICE)>out3 or time>1456000)) then BEGIN
SELLSHORT(1,1,limitr,close);
end
//开多单
If(holding=0 and Open<close and time<143000)then BEGIN
BUY(1,1,limitr,close);
end
Ruhigh=HHV(High,ENTERBARS);//获得开仓以来的最低价
windots2=Ruhigh-ENTERPRICE;//计算盈利点数
outdots2=Ruhigh-close;
//盈利离场
If(holding>0 and windots2>win1 and windots2<win2 and outdots2>out1)then BEGIN
sell(1,1,limitr,close);
elseif(holding>0 and windots2>win2 and windots2<win3 and outdots2>out2) THEN BEGIN
sell(1,1,limitr,close);
Elseif(holding>0 and windots2>win3) THEN BEGIN
sell(1,1,limitr,close);
end
END
END
//止损离场
if(holding>0 and ((ENTERPRICE-close)>out3 or time>1456000))THEN BEGIN
sell(1,1,limitr,close);
end
运行的时候提示有错,不知道怎么改?
您好,您运行的时候提示什么错!--------------------------------------------
{ NumericSeries Rulow;//开仓以来最低价
NumericSeries Ruhigh;//开仓以来最高价
Numeric windots1; //赢利点
Numeric outdots1;//出场点
Numeric windots2; //赢利点
Numeric outdots2;//出场点
}
您这些变量都没有定义,用variable定义下
//盈利离场
If(holding<0 and windots1>win1 and windots1<win2 and outdots1>out1) then begin
SELLSHORT(1,1,limitr,close);
end
if(holding<0 and windots1>win2 and windots1<win3 and outdots1>out2) then begin
SELLSHORT(1,1,limitr,close);
end
if(holding<0 and windots1>win3) then BEGIN
SELLSHORT(1,1,limitr,close);
end
这个语句有错误吗?提示说begin后面缺少end
好像自己后面少了个end,现在正常了,谢谢了
您好,在工具-选项里面的多秒周期换成2min。
快捷方式直接键盘精灵输2min