← All projects

MT5 Gold Session-Breakout EA

A conservative XAUUSD Expert Advisor that trades Asian-range breakouts in the London and New York sessions, with a higher-timeframe trend filter and a layered capital-protection stack.

Client
Retail gold trader
Year
2026
Category
Trading Systems
Stack
  • MQL5
  • MetaTrader 5

The problem

The client wanted a gold EA built around capital preservation rather than aggressive growth. It had to trade at most a set number of times per session, stop itself after drawdowns or losing streaks, and work on any broker’s symbol naming.

What I built

  • Asian range: the high and low of a configurable Asian window (GMT-based inputs) set the breakout levels, plus a buffer.
  • Session windows: separate London and New York entry windows that can be turned on or off. There is a max number of trades per session (re-entry after a stop) and a max number of concurrent positions.
  • Trend filter: off, single timeframe or both timeframes, with an option to allow trades when the trend is neutral. A breakout-only mode ignores the trend.
  • Range quality filters: a min and max range in points, and a min/max ratio of today’s range to the average range. There is also a spread cap and an optional Friday skip.
  • Risk: balance-based sizing at a set risk percent with a hard cap, and a fixed risk-to-reward target.
  • Protection stack:
    • a peak-drawdown pause
    • an equity stop measured from the starting balance
    • a consecutive-loss pause that either stops for the day or skips the next session
  • Symbol handling: a configurable symbol name for broker suffixes and prefixes, and automatic adaptation to the symbol’s digits.
  • On-chart dashboard with a configurable position and colours.

Details

  • Comparing today’s range with the average range filters out both dead sessions and news spikes, before any breakout logic runs.