交易问题:信号反手不开,反手后要么撤单,要么平,要么开,涉及到一根K线上处理开平撤单的问题
cond1:=FILTER(c>o,10);
cond2:=FILTER(c<o,10);
if TISREMAIN(3)<>0 AND COND1 then
BEGIN
tcancel(1,0);
END
else
if TISREMAIN(1)<>0 AND COND2 then
BEGIN
tcancel(1,0);
END
if THOLDING2=0 then BEGIN
tbuy(COND1,1,lmt,C-20*MINDIFF);
tbuyshort(COND2 ,1,lmt,C+20*MINDIFF);
END
IF THOLDING>0 then begin
tsell(COND2 ,0,lmt,DYNAINFO(28));
end
if tholding<0 then begin
tsellshort(COND1 ,0,lmt,DYNAINFO(34));
END
if TISREMAIN(0)<>0 AND COND1 then
BEGIN
tcancel(1,0);
END
if COND1 then BEGIN
tsellshort(COND1 and tholding<0,0,lmt,DYNAINFO(34));
tbuy(COND1 and tholding=0,1,lmt,C-20*MINDIFF);
END
IF cond 2 then begin
tsell(COND2 and tholding>0 ,0,lmt,DYNAINFO(28));
tbuyshort(COND2 and tholding=0,1,lmt,C+20*MINDIFF);
end
if TISREMAIN(0)<>0 AND COND1 then
BEGIN
tcancel(1,0);
END
后面要不要加上
if TISREMAIN(0)<>0 AND COND2 then
BEGIN
tcancel(1,0);
END
要写,我漏了
对啊,反手下单就是这样先平后开的, 你要顺序下单?
if COND1 then BEGIN
tsellshort(COND1 and tholding<0,0,lmt,DYNAINFO(34)),orderqueue;
tbuy(COND1 and tholding=0,1,lmt,C-20*MINDIFF),orderqueue;
END
IF cond 2 then begin
tsell(COND2 and tholding>0 ,0,lmt,DYNAINFO(28)),orderqueue;
tbuyshort(COND2 and tholding=0,1,lmt,C+20*MINDIFF),orderqueue;
end