if not(islastbar) or workmode<>1 then exit;
ac:='802089';
wt:=tremainqty(0,ac,'');
buyhold1:=tbuyholdingex(ac,'if06',1);
buyhold2:=tbuyholdingex(ac,'if09',1);
sellhold1:=tsellholdingex(ac,'if06',1);
sellhold2:=tsellholdingex(ac,'if09',1);
if wt>0.5 or not(buyhold1>-0.5 and buyhold2>-0.5 and sellhod1>-0.5 and sellhodl2>-0.5) then exit;
if bb and (sellhold2>0.5 and buyhold1>0.5) then begin
tsellshort(1,0,lmt,远期卖一+3,0,'802089','if09'),allowrepeat;
tsell(1,0,lmt,近期买一-3,0,'802089','if06'),allowrepeat;
sleep(1000);
end
if bb and (sellhold2<0.5 and buyhold1<0.5 and buyhold2=0 and sellhold1=0) then begin
tbuy(1,1,lmt,远期卖一+3,0,'802089','if09'),allowrepeat;
tbuyshort(1,1,lmt,近期买一-3,0,'802089','if06'),allowrepeat;
sleep(1000);
end
if ss and (sellhold1>0.5 and buyhold2>0.5) then begin
tsell(1,0,lmt,远期买一-3,0,'802089','if09'),allowrepeat;
tsellshort(1,0,lmt,近期卖一+3,0,'802089','if06'),allowrepeat;
sleep(1000);
end
if ss and (sellhold1<0.5 and buyhold2<0.5 and sellhold2=0 and buyhold1=0) then begin
tbuyshort(1,1,lmt,远期买一-3,0,'802089','if09'),allowrepeat;
tbuy(1,1,lmt,近期卖一+3,0,'802089','if06'),allowrepeat;
sleep(1000);
end
[此贴子已经被作者于2012-5-31 11:30:26编辑过]