Skip to content
All library documents

Relative Moving Average Trading with Fractile Crossings and Adaptive Exits

Article MQL5 code base

Summary

This Expert Advisor implements a Relative Moving Average framework that ranks the latest close within a trailing window’s return distribution, producing a fractile between zero and one. Instead of using price distances, its rules trade movements between distribution extremes. Four entry legs cover full traversals and reversals partway through a traversal. An adaptive exit selects between a full crossover exit and an extremum-reversal trigger according to the detected market regime; separate adverse-movement logic can close losing positions and temporarily block re-entry in the same direction. The EA reads calculations from a companion indicator and acts on closed bars.

The document reports one EURUSD H2 backtest over roughly fourteen months, with 138 trades, positive net profit, a profit factor of 1.15, and a 4.52% maximum equity drawdown. This is a single reported run, not evidence of robustness across assets or periods. The paper supplies the framework but, according to the document, does not provide its own track record. The suggested settings were tested only on EURUSD H2, so performance elsewhere remains unestablished.

Key ideas

  • The RMA maps the latest close to its rank within a trailing window’s return distribution.
  • Four strategy legs trade full fractile traversals and moves that reverse before reaching the opposite extreme.
  • The adaptive exit uses regime detection to choose between crossover and reversal-based exits.
  • A safety exit responds to continued adverse fractile movement and can block immediate same-side re-entry.
  • The reported performance comes from one EURUSD H2 backtest and does not establish broader robustness.

Tags

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