c1:=条件1;
c2:=条件2;
c3:=条件3;
if c1+c2+c3=3 then buy(holding=0,3,marketr);
if c1+c2+c3=2 then buy(holding=0,1,marketr);
if c1+c2+c3=1 then buyshort(holding=0,1,marketr);
if c1+c2+c3=0 then buyshort(holding=0,3,marketr);
我还以为你会自己加平仓进去
c1:=条件1;
c2:=条件2;
c3:=条件3;
if c1+c2+c3=3 then begin
sellshort(1,0,marketr);
buy(holding=0,3,marketr);
end
if c1+c2+c3=2 then begin
sellshort(1,0,marketr);
buy(holding=0,1,marketr);
end
if c1+c2+c3=1 then begin
sell(1,0,marketr);
buyshort(holding=0,1,marketr);
end
if c1+c2+c3=0 then begin
sell(1,0,marketr);
buyshort(holding=0,3,marketr);
end