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
http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=73952
樓上
1,這個你要學習下vba的一些知識哦
OrderStatusEx2 用這個事件跟蹤下報單ID的返回情況,就可以實現實際需求的下單隊列,以及追撤單