非逐筆交易(60分鐘線)小型台指
請問我在9/25 18:00 收K進場小台 出場如下 進場點22927
想詢問為什麼在9/25 23:00 這個K棒收盤沒出場
9/25 23:00 最高價 23032 (23032-成本價22927=105點) 啟動移動停利回跌/回跌50點出場
9/25 22:00 這個K棒收盤沒出場(收盤價在22954)最高23032-22954=78點 /有回掉78點應該要出場...?
還是我理解錯誤...
input: profit_point(50, "停利(點)");
input: profit_drawback_point(50, "停利回跌(點)");
input: loss_point(50, "停損(點)");
if profit_point = 0 then raiseruntimeerror("請設定停利(點)");
if profit_drawback_point = 0 then raiseruntimeerror("請設定停利回跌(點)");
if profit_drawback_point > profit_point then raiseruntimeerror("停利(點)需大於停利回跌(點)");
if Position > 0 and Filled > 0 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;
end;
5 評論