//多單停損(%)
input: profit_percent(3.5, "停利(%)");
input: loss_percent(0.9, "停損(%)");
if Filled > 0 then begin
{ 依照成本價格設定停損/停利 }
if profit_percent > 0 and
Close >= FilledAvgPrice*(1+0.01*profit_percent) then begin
{ 停利 }
SetPosition(0, label:="停利出場");
end else if loss_percent > 0 and
Close <= FilledAvgPrice*(1-0.01*loss_percent) then begin
{ 停損 }
SetPosition(0, label:="停損出場");
end;
end;
//空單停損(%)
if Filled < 0 then begin
{ 依照成本價格設定停損/停利 }
if profit_percent > 0 and
Close <= FilledAvgPrice*(1-0.01*profit_percent) then begin
{ 停利 }
SetPosition(0, label:="停利出場");
end else if loss_percent > 0 and
Close >= FilledAvgPrice*(1+0.01*loss_percent) then begin
{ 停損 }
SetPosition(0, label:="停損出場");
end;
end;
請問卷賣時,為何自動交易中心無法抓到庫存? 要如何解決? 謝謝您
6 評論