//开仓部分
持仓:=holding;
GLOBALVARIABLE:biaoji=0;
GLOBALVARIABLE:zuigao=0;
GLOBALVARIABLE:zuidi=0;
if dynainfo(7)-tenterprice>50 and THOLDING2>0 and biaoji=0 then begin
zuigao:=HIGH;
biaoji:=1;
end
if HIGH>zuigao and THOLDING2>0 then zuigoa:=HIGH;
if LOW<zuigao-1 and THOLDING2>0 then begin
tsell(1,0,mkt);
biaoji:=0;
end
if tenterprice-dynainfo(7)>50 and THOLDING2<0 and biaoji=0 then begin
zuidi:=LOW;
biaoji:=1;
end
if LOW<zuidi and THOLDING2<0 then zhuidi:=LOW;
if HIGH>zuidi-1 and THOLDING2<0 then begin
tsellshort(1,0,mkt);
biaoji=0;
end
//一开仓就平单,要命了
if HIGH>zuigao and THOLDING2>0 then zuigoa:=HIGH;
加粗的这个写错了,导致全局变量没有赋值正确
持仓用holding是不对的,后台的是tholding
谢谢,我这粗心的,呵呵