//開倉部分
持倉:=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
//一開倉就平單,要命了
[此貼子已經被作者于2014/5/8 10:14:42編輯過]
if HIGH>zuigao and THOLDING2>0 then zuigoa:=HIGH;
加粗的這個寫錯了,導致全局變量沒有賦值正確
持倉用holding是不對的,后臺的是tholding
謝謝,我這粗心的,呵呵