想請教 回測 當中 ,整段程式碼都是正確的狀況下 停損或是回補 有可能停損不到或回補不到嗎?
這是其中 我設置 停損 及 尾盤回補的程式碼 可否幫看看問題出在哪?
我設置的狀況 都是當天出場 但會有隔好幾天才出場的狀況
var: intrabarpersist stoploss(0); //
stoploss = getfield("High", "D"); //
condition = close cross over stoploss; //
if condition4 and position = -1 then begin //
setposition(0, addspread(stoploss, 1 )) ;
stoploss = 0;
end;
尾盤回補設定目前為
if (time >= 123000 and position = -1) then begin setposition(0, market);
end; //
勞煩幫忙查看問題 萬分感謝
2 評論