variable:n=0;
if n=0 and 開(kāi)多條件 then begin
buy.........;
n:=1;
end
if n=0 and 開(kāi)空條件 then begin
buy..........;
n:=1;
end
if n=1 and 開(kāi)多條件 and enterbars>0 and exitbars>0 then begin
buy.......;
end
if n=1 and 開(kāi)空條件 and enterbars>0 and exitbars>0 then begin
buyshort.......;
end
if n=1 and 平多條件 and enterbars>0 and exitbars>0 then begin
sell.......;
end
if n=1 and 平空條件 and enterbars>0 and exitbars>0 then begin
sellshort.......;
end