RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
kd:=K>D and c>o ;//开多平空条件
pd:=c<o;
kk:=k<d and c<o;//开空平多条件
pk:=c>o;
if TISREMAIN(3)<>0 AND kd then
BEGIN
tcancel(1,0),ORDERQUEUE;
END
if TISREMAIN(1)<>0 AND kk then
BEGIN
tcancel(1,0),ORDERQUEUE;
END
if TISREMAIN(1)<>0 AND pd and tholding2<>0 and tholding=0 then
BEGIN
tcancel(1,0),ORDERQUEUE;
END
if TISREMAIN(3)<>0 AND pk and tholding2<>0 and tholding=0 then
BEGIN
tcancel(1,0),ORDERQUEUE;
END
if PK then BEGIN
tsellshort( tholding<0,0,lmt,DYNAINFO(28)),ORDERQUEUE;
END
if KD and TISREMAIN(0)=0 then BEGIN
tbuy( tholding=0,1,lmt,c-30*MINDIFF),ORDERQUEUE;
END
IF pd then begin
tsell( tholding>0 ,0,lmt,DYNAINFO(34)),ORDERQUEUE;
END
IF KK and TISREMAIN(0)=0 then begin
tbuyshort (tholding=0,1,lmt,c+30*MINDIFF),ORDERQUEUE;
end