小幫手好
我是用交易模組串選股的商品做回測
前幾天回測都是正常的
昨天開始,同樣的策略一直回測不出結果,都是執行異常206
試了好幾個之前成功回測的策略都是同樣的狀況
就算選股策略用很簡單的也這樣
查看狀態,都有些股票都在等待中
刪暫存檔、重啟電腦、升級到最新版都沒用
這個問題應該是發生在選股商品為上市股的時候
交易用程式碼如下,選股隨便找一個,商品選全部上市股,應該就能重現問題了
謝謝
input:profitex(10,"獲利多少出場%"),lostex(10,"虧損多少出場");
var:intraBarPersist dayentry(0);
//控制當天出場後,不會當天又再進場
if date<>date[1] and currenttime=090000 then dayentry=0;
if date<>date[1] and position=0 and dayentry=0 then setposition(1);
//if date<>date[1] and position=0 and dayentry=0 and getfield("close","D")[1]<=maxprice then setposition(1);
if position>0 and filled>0
and (close>=filledAvgPrice*(1+profitex*0.01)
or close<=filledAvgPrice*(1-lostex*0.01))
then begin
dayentry=1;
setposition(0);
end;




10 評論