variable:aa=0;
if c>aa then aa:=c;
if aa>0 and c<=aa-10*mindiff and holding=1 then sell(holding>0,1,thisclose);
if aa>0 and c<=aa-20*mindiff and holding=2 then sell(holding>0,2,thisclose);
if holding=2 then begin
sell(l<=h135-10,1,LIMITR,h135-10);
sell(l<=h135-20,1,LIMITR,h135-20);
end
这样 表达对么
variable:aa=0,bb=0;
加个开仓语句保证全局变量不出错
if buycond then begin
buy();
aa:=0;
bb:=0;
end
if c>aa then aa:=c;
if aa>0 and c<=aa-10*mindiff and holding=1 then sell(holding>0,1,thisclose);
if aa>0 and c<=aa-10*mindif and holding=2 and bb=0 then begin
sell(holding>0,1,thisclose);
bb:=1;
end
if aa>0 and c<=aa-20*mindiff and bb=1 then sell(holding>0,1,thisclose);