請問一下,以下語法在交易腳本回測中,都可以符合condition2 or _count>=10 的條件出場,但在實際進場後,condition2仍是正常執行會被觸發而出場,但_count>=10符合時,就不會被觸發執行,會是因為我的電腦每天會關機的關係嗎?如果是的話可以怎麼修改語法讓_count>=10能正常被觸發
<交易腳本,日頻率,逐筆洗價,指定選股>
<策略部位為延續前次執行,自動執行有部位商品啟用>
var:_count(0);
condition1=進場條件
condition2=出場條件
if position=0 and filled=0 and condition1 then begin
_count=0;
setposition(1,mraket);
end;
if filled>0 then _count +=1
if position>0 and filled>0 and condition2 then setposition(0,market);
end else if _count>=10 then setposition(0,market);
5 評論