variable:dy=0,ds=0;
variable:yy=0,ys=0;
if 多头止损条件 and holding>0 then begin
sell(1,0,market);
if time>010000 and time<=063000 then ys:=ys+1;
if time>130000 and time<=190000 then ds:=ds+1;
end
if 空头止损条件 and holding<0 then begin
sellshort(1,0,market);
if time>010000 and time<=063000 then ys:=ys+1;
if time>130000 and time<=190000 then ds:=ds+1;
end
if 多头止赢条件 and holding>0 then begin
sell(1,0,market);
if time>010000 and time<=063000 then yy:=yy+1;
if time>130000 and time<=190000 then dy:=dy+1;
end
if 空头止赢条件 and holding<0 then begin
sellshort(1,0,market);
if time>010000 and time<=063000 then yy:=yy+1;
if time>130000 and time<=190000 then dy:=dy+1;
end
if time=closetime(1) then begin
yy:=0;
ys:=0;
end
if time=closetime(0) then BEGIN
dy:=0;
ds:=0;
end
需要在开仓条件里面加上 (ds<2 or ys<2 or dy<1 or dy<1)
2.
nn:=STRLEN(stklabel);
ss:=strleft(stklabel,nn-2);
if stricmp(ss,'rb')=0 then m:=8;
if stricmp(ss,'srx')=0 then m:=6;
if stricmp(ss,'ma')=0 then m:=8;