以下這段內容是我的出場條件
if filled <> 0 and currenttime >= 132000 then begin
setposition(0, market);
end;
input: profit_point(1, "停利(%)");
input: profit_drawback_point(3, "停利回跌(點)");
input: loss_point(2, "停損(%)");
if Position > 0 then begin
var: intrabarpersist max_profit_point(0); { 啟動停利後最大獲利點 }
if loss_point > 0 and Close <= (FilledAvgPrice*((100-loss_point)*0.01)) then begin
{ 停損 }
setposition(0, market);
max_profit_point = 0;
end else begin
{ 判斷是否要啟動停利 }
if max_profit_point = 0 and Close >= (FilledAvgPrice*((100+profit_point)*0.01)) 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, market);
max_profit_point = 0;
end else if Close > max_profit_point then begin
{ 移動最大獲利點 }
max_profit_point = Close;
end;
end;
end;
end;
但我發現好像只會觸動到132000時強制平倉
其餘的停損跟停利都沒做動到
請幫我看一下哪裡出問題
我也爬了之前別人的文章也發覺很多人也都套用系統的腳本改寫但是都沒動作
還有一篇是回覆縮排撰寫
但是也不知道哪裡可以縮
1 評論