您好,以下是我的語法,多單停損的點位有幾筆遠遠超過設定值(設定低於下單價格30點時,出場),請問可以幫我找出問題嗎? 謝謝您。附件有回測紀錄
// 宣告參數
if barFreq="min" then begin
value1=average(c,960/barInterval);
end;
var: stop_point(0), controller(0);
var: intrabarpersist max_profit_point(0); { 啟動停利後最大獲利點 }
input: profit_point(30, "停利(點)");
input: profit_drawback_point(5, "停利回跌(點)");
input: loss_point(30, "停損(點)");
// 多方進場策略
if position = 0 and filled = 0 and close cross over value1-110 then setposition(1);
//停損單
if position > 0 and filled > 0 then begin
if loss_point > 0 and Close <= FilledAvgPrice - loss_point then begin
{ 停損 }
SetPosition(0);
max_profit_point = 0;
end else begin
//停利單
if max_profit_point = 0 and Close >= FilledAvgPrice + profit_point then begin
max_profit_point = Close;
end;
if max_profit_point <> 0 then begin
if Close <= max_profit_point - profit_drawback_point then begin
{ 停利 }
SetPosition(0);
max_profit_point = 0;
end else if Close > max_profit_point then begin
{ 移動最大獲利點 }
max_profit_point = Close;
end;
end;
end;
end;
1 評論