Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Experts

Channel Breakout EA with ATR trailing stop and risk-percent sizing - expert pour MetaTrader 5

Bolot Aliev
Bolot Aliev
I build trading tools that do exactly what the specification says — and I test them before delivery.
- MQL5 Expert Advisors and indicators: entries/exits by your rules, ATR/fixed stops, trailing, partial take-profit, break-even, risk-per-trade sizing, news/time filters.
Vues:
57
Publié:
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

A simple, fully commented trend-following Expert Advisor for MetaTrader 5. It opens a trade when a bar closes beyond the highest high or the lowest low of the previous N bars (Donchian channel breakout). An optional EMA filter allows longs only above the EMA and shorts only below it.

Signals are calculated once per bar on the closed bar, so testing with "Open prices only" and "Every tick" gives the same entries. The EA keeps one position per symbol and magic number, so it can run on several charts at once.

Risk and exits

  • The initial stop-loss is k x ATR and is sent together with the order.
  • The lot size is calculated so that the loss at the stop equals the chosen percentage of the balance. The volume is rounded down to the volume step; if it is below the minimum lot, the trade is skipped.
  • The stop moves to break-even after the price closes +R in profit (R = the initial stop distance).
  • The ATR trailing stop follows the bar close and only moves in the trade's favour.

Inputs

  • InpChannel (20) - channel length in bars
  • InpUseEMA (true), InpEMA (200) - EMA trend filter on/off and its period
  • InpATR (14) - ATR period
  • InpStopATR (1.5) - initial stop in ATR
  • InpTrailATR (3.0) - trailing stop in ATR, 0 = off
  • InpBE_R (1.0) - move the stop to break-even after +R, 0 = off
  • InpRiskPct (0.5) - risk per trade, % of balance
  • InpMagic - magic number; InpLongs, InpShorts - allowed directions

Example: XAUUSD H1, January 2024 - October 2026, default inputs, 0.5% risk per trade: 428 trades, profit factor 1.40, maximum equity drawdown 7.8% (balance chart attached). A large part of this result comes from the 2024-2026 gold rally; other symbols and periods will differ. H1-H4 timeframes on trending instruments suit the idea best. Past results do not guarantee future results; test on a demo account first.

InputRules: Rules Between Inputs and the Share of Passes They Reject InputRules: Rules Between Inputs and the Share of Passes They Reject

A library for MetaTrader 5 that declares rules between the inputs of an Expert Advisor once in the code. OnInit rejects a combination that breaks a rule, with the reason in the Journal; before an optimization starts, OnTesterInit estimates which share of its passes the rules would reject and warns above a limit you set.

Prop Firm Equity Guard Prop Firm Equity Guard

Protects prop firm challenge and funded accounts: watches equity in real time and closes all trades before the daily loss or maximum loss limit is broken, with an optional profit target lock and a live progress panel.

ATR Volatility Risk and Position Size Calculator HUD ATR Volatility Risk and Position Size Calculator HUD

Zero-DLL on-chart HUD that calculates ATR-based Stop-Loss/Take-Profit distances and broker-normalized lot sizes across 3 configurable risk tiers.

MACD Signals MACD Signals

Indicator edition for new platform.