自動交易回測時出現很奇怪的錯誤[1101], 不管用不用逐筆洗價都會出現這個錯誤, 找了很久發現跟下列含式用法有關
SetPosition(0, MARKET);{ 以市價賣出 }
if Position = 0
then begin
if _buy_keep > close then _print_str = "賣空停利";
if _buy_keep <= close then _print_str = "賣空停損";
if filledRecordPrice(FilledRecordCount) > _buy_keep then _print_str = "買多停利";
if filledRecordPrice(FilledRecordCount) <= _buy_keep then _print_str = "買多停損";
Print(file("c:\temp\"), currentDate , currentTime, "買多",_mode,filledRecordPrice(FilledRecordCount),_print_str);
問題出在這個 filledRecordPrice(FilledRecordCount) , 這樣子寫不是應該會取得最後一筆交易的單價嗎?
感覺很像系統回測的Bug
請協助解決
1 評論