if 多单止盈条件 and holding>0 then sell(1,0,market);
if 空单止盈条件 and holding<0 then sellshort(1,0,market);
variable:n=0;
if 开多条件 and holding=0 and n=0 then begin
buy(1,1,market);
n:=1;
end
if 开空条件 and holding=0 and n=0 then begin
buyshort(1,1,market);
n:=1;
end
然后下面就是日线和分钟线的区别了:
日线:
n:=0;
分钟线:
if time=closetime(0) then n:=0;
jinzhe 老师 |
C>MA(C,5); KD:=C>MA(C,5); //开多条件 PD:=C<MA(C,5); //平多条件 KK:=C<MA(C,5); //开空条件 PK:=C>MA(C,5); //平空条件 平空:SELLSHORT(PK,1,THISCLOSE); //平空信号 开多:BUY(KD AND HOLDING=0,1,THISCLOSE); //开多信号 平多:SELL(PD,1,THISCLOSE); //平多信号 开空:BUYSHORT(KK AND HOLDING=0,1,THISCLOSE); //开空信号
|