Skip to content
All library documents

A Gold M15 EA Using Liquidity Sweeps and Order Blocks

Article MQL5 code base

Summary

This document describes an intraday XAUUSD strategy that looks for a wick to breach a confirmed swing high or low and then close back across it. The sweep candle defines an order block; a later candle must close through that zone with sufficient range to confirm entry. Trades follow the H1 direction relative to a 50-period EMA. The EA enters at market, places a stop beyond the sweep wick, targets twice the stop distance, and risks a fixed share of account balance. It holds one position at a time and includes spread, session-end, and stop-placement safeguards.

Backtests on one demo server report modest positive results for 2025 and January through September 2026, with profit factors of 1.12 and 1.10 and drawdowns near 10.5%. The author highlights a thin edge, losing streaks, slippage around scheduled news, weekend gap exposure, and broker spread and commission sensitivity. The periods use different tick modelling, and the results come from a single broker’s data, so they do not establish robustness or live profitability.

Key ideas

  • The setup trades confirmed swing sweeps followed by a close through the sweep candle’s body.
  • An H1 moving average filter determines whether the EA takes long or short setups.
  • Stops are placed beyond the sweep wick, while the profit target is twice the stop distance.
  • Position sizing based on order profit calculations corrected a tick-value error that had overstated risk.
  • Reported profits are modest, and costs, news slippage, losing streaks, and weekend gaps can materially affect results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.