거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

Trailing Stop That Starts at the Take-Profit Level - MetaTrader 5용 expert

Gilberto Cardona Velez
Gilberto Cardona Velez
  • MQL4/MQL5 developer - Expert Advisors, backtests and strategy conversion 에  Laboratorio de Estrategias
  • 콜롬비아
  • 878
Laboratorio de Estrategias - MQL4/MQL5 development with tested, honest results.
SMALL JOBS FROM 30 USD (MQL5 Freelance, usually delivered in 1-3 days):
- Fixes and changes to an existing EA or indicator (source code required)
- Adapting one of my free CodeBase tools to your own rules
조회수:
197
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This utility works on positions that are already open, whether you opened them by hand or with another Expert Advisor. When the price gets close to the take profit, instead of letting the trade close there, it starts a trailing stop so the trade can keep running while part of the profit is protected. It never opens or closes trades by itself: it only changes the stop loss and the take profit of existing positions.

What it does

  1. Waits for the take-profit zone. For each position that has a take profit, it measures the way from the entry price to the take profit. When the price has covered the percentage you choose (default 90%), trailing starts.
  2. Handles the take profit. You choose: remove it, move it further away by a percentage of the original distance, or keep it.
  3. Trails the stop. The stop follows the price at a fixed distance in points, or at a percentage of the original take-profit distance. It is never moved backwards, it only changes when it improves by at least the minimum step, and it respects the broker's minimum stop distance.

Inputs

  • Start at this % of the way from entry to take profit (1-99)
  • Trailing distance in points, or as a % of the original take-profit distance
  • Minimum step to move the stop
  • Take profit action: remove, extend or keep (and the extension %)
  • Positions to manage: this chart's symbol or all symbols
  • Magic number filter (-1 = any, 0 = manual trades only)
  • Status panel on the chart

Things to know

  • The take profit is stored on the broker's server and closes the trade as soon as the price touches it. That is why the tool must start before 100% of the way; the start value is limited to 1-99%.
  • A position without a take profit is ignored, because there is no level to work from.
  • The tool remembers which positions are already trailing in terminal global variables, so restarting the terminal does not lose them. It only works while the terminal is running with Algo Trading enabled.
  • If the broker rejects a change (for example, market closed), it waits 60 seconds before trying again.
  • A gap or a fast market can jump over the stop: the exit price is not guaranteed.

How it was tested

MetaTrader 5 Strategy Tester, EURUSD, real ticks, September-October 2026, with an internal copy that opens test trades only to exercise the tool: 77 test trades, trailing started on 40 of them, 353 further stop moves, 0 backward moves. This is a functionality test, not a profitability claim.

Test it on a demo account first.

Not financial advice. Past results do not guarantee future results.

Gold MACD Divergence Map Gold MACD Divergence Map

MACD regular and hidden divergences on closed bars with an honest first-touch statistics panel. Not a trading signal.

Close By Filter - close positions by side, symbol, magic number and profit Close By Filter - close positions by side, symbol, magic number and profit

Closes only the open positions that match your filters and, if you choose, deletes matching pending orders. Shows a summary and asks before it acts.

TradeGateway: Fake Broker for Trade Management Tests TradeGateway: Fake Broker for Trade Management Tests

A library for MetaTrader 5 that puts trade management code behind an interface and tests it against a fake broker, without a trade server. The fake checks stops level, freeze level, tick grid and volume step, answers with retcodes chosen by the test and logs every request. An example break-even rule and 26 test cases come with it.

Backtest Data Preflight: check broker bar and tick history Backtest Data Preflight: check broker bar and tick history

Check the first and last available bars, gaps between bars, and available MT5 tick history for a date range before a backtest.