請問我的停損利+移停的語法哪邊有問題會造成這種情況
有非常多筆這種大幅虧損,都是該停沒停 抱很多期數
以下是我的出場語法,
if Position = 1 and Filled = 1 then begin
var: intrabarpersist max_profit_point(0); { 啟動停利後最大獲利點 }
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;

1 評論