又來請教各位大大~~1分K 不用逐筆洗價也不自動洗價 讀取筆數5000
移動停利止損我加MAXLIST( BOUT = Maxlist(BOUT, H - loss_point);)來判斷,應該BOUT只會往上移不該往下降才對~~我是哪個環節沒搞清楚,BOUT會改變 我是哪忘設定什麼
請大大們 幫忙解惑~~
// 初始化變數
var: BCost(0), BOUT(0); // 多單
input: move_profit_point(8, "移動停利(點)");
input: loss_point(30, "停損點(點)");
if position = 1 and filled = 1 then begin
BCost = filledAvgPrice;
BOUT = BCost - loss_point;
Print("進場成功: BCost=", BCost, ", BOUT=", BOUT);
end;
// 移動停利============================
if position = 1 and filled = 1 then begin
if C > BCost + move_profit_point then begin
BOUT = Maxlist(BOUT, H - loss_point);
Print("移動停利: 當前價格=", C, ", 更新後 BOUT=", BOUT);
end;
end;
// 出場============================
if position = 1 and filled = 1 then begin
// value100 = TimeAdd(Time, "S", 50);
// if currentTime > value100 then begin
if Close < BOUT then begin
Print("出場條件成立: 收盤價=", Close, ", BOUT=", BOUT);
SetPosition(0, Market);
end;
//end;
5 評論