开仓语句不都是正常的吗
if holding>0 and (sellcond or exittime) then begin
sell(1,0,market);
cc:=0;
end
if holding<0 and (sellshortcond or exittime) then begin
sellshort(1,0,market);
cc:=0;
end
if holding=0 and entertime and buyshortcond then begin
buyshort(acc or tsellholding(1)>0,1,market);
if islastbar then extgbdataset('isbook',0);
cc:=-1;
maxprofit:=0;
end
if holding=0 and entertime and buycond then begin
buy(acc or tbuyholding(1)>0,1,market);
if islastbar then extgbdataset('isbook',0);
cc:=1;
maxprofit:=0;
end
if not(islastbar and workmode=3) then exit;
if tholding2=0 and cc>0 and extgbdata('isbook')=0 then begin
buy(1,1,market);
if islastbar then pp:=enterprice;
extgbdataset('isbook',1);
end
if tholding2=0 and cc<0 and extgbdata('isbook')=0 then begin
buyshort(1,1,market);
if islastbar then pp:=enterprice;
extgbdataset('isbook',1);
end
持仓:holding,LINETHICK0;
variable:cc=0;
runmode:0;
entertime:=time<closetime(0) and time>opentime(1)+100;
exittime:=time>=closetime(0);
buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);
acc:=not(islastbar);
if holding>0 and (sellcond or exittime) then begin
sell(1,5,limitr,o);
cc:=0;
end
if holding<0 and (buycond or exittime) then begin
sellshort(1,5,limitr,o);
cc:=0;
end
if holding=0 and entertime and buycond then begin
buy(acc or tbuyholding(1)>0,5,limitr,o);
if islastbar then extgbdataset('isbook',0);
cc:=5;
end
if holding=0 and entertime and sellcond then begin
buyshort(acc or tsellholding(1)>0,5,limitr,o);
if islastbar then extgbdataset('isbook',0);
cc:=-5;
end
if not(islastbar and workmode=3) then exit;
if tholding2=0 and cc>0 and extgbdata('isbook')=0 then begin
buy(1,5,limitr,o);
if islastbar then pp:=enterprice;
extgbdataset('isbook',1);
end
if tholding2=0 and cc<0 and extgbdata('isbook')=0 then begin
buyshort(1,5,limitr,o);
if islastbar then pp:=enterprice;
extgbdataset('isbook',1);
end