在逻辑上或语句上有什么问题,程序本来是要多,要么空,要么没有单,可今天出现了一个情况,
//开多
if dblcom then begin
sellshort(holding<0,holding,market),orderqueue;
buy(holding=0,sv,market);
end else begin
if (long and not(ddblcom)) then begin
sellshort(holding<0,0,market),orderqueue;
buy(holding=0,sv,market);
end
end
//开空
if ddblcom then begin
sell(holding>0,0,market),orderqueue;
buyshort(holding=0,sv,market);
end else begin
if (short and not(dblcom)) then begin
sell(holding>0,0,market),orderqueue;
buyshort(holding=0,sv,market);
end
end
//平多
if longX then begin
sell(holding>0,0,market);
end
//平空
if shortX then begin
sellshort(holding<0,0,market);
end
36 17:03:48
先开了多,随后又平多开空,可是帐户上多单还在。