Blog / Strategy
Strategy

Harmonic Octave Reversion

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

The Harmonic Octave Reversion strategy is a mean-reversion system built around a Murray-Math-style octave grid, a harmonic-subdivision technique that traces its roots to the work of W.D. Gann and later T.H. Murray. The core idea is that a defined price range tends to respect harmonic subdivisions of itself. This expert advisor (EA) takes the recent trading "frame" — the highest high and lowest low of a lookback window — and slices it into eight equal levels, or "octaves," where 0/8 is the frame low, 4/8 is the mid axis (fair value), and 8/8 is the frame high.

Mean reversion is a trading style that assumes price stretched to an extreme is more likely to snap back toward an average than to continue in a straight line. The Harmonic Octave Reversion strategy applies this idea specifically to failed probes of the frame extremes. When a candle pierces the 0/8 line but closes back inside the frame, the strategy interprets this as a failed downside breakout — a signal that the auction at that extreme is exhausted and price may be pulled back toward the 4/8 mid axis. The mirror logic applies to failed probes of the 8/8 line on the upside.

As a learning tool, this strategy is well suited to traders who want to study range-bound, balanced market behavior and how harmonic price levels can be defined objectively. It is best understood as a case study in mean-reversion mechanics — combining level detection, a trend filter, and disciplined reward-to-risk gating — rather than as a shortcut to any particular outcome. It suits intermediate learners comfortable with concepts like ATR (Average True Range) and EMA (Exponential Moving Average).

How It Works

The strategy evaluates conditions once per closed bar and works exclusively on a single timeframe. Here is the logic in plain English:

harmonic octave reversion MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
FramePeriod 64 24 200 Number of prior bars used to build the octave frame (highest high / lowest low).
MinFrameAtr 3.0 1.0 8.0 The frame must span at least this many ATRs to be considered tradeable.
SlopeEmaPeriod 50 10 150 Period of the EMA used to gauge the prevailing trend for the slope gate.
FlatSlopeAtr 1.0 0.2 3.0 Rejects a fade if the opposing EMA slope (measured in ATR units) exceeds this.
AtrPeriod 14 5 30 Lookback period for the Average True Range volatility measure.
AtrStopMult 1.2 0.5 3.0 Stop sits this many ATRs beyond the pierced frame extreme.
MinRewardRisk 1.2 0.8 3.0 Minimum reward-to-risk ratio (target vs stop) required to take a trade.
BreakevenPct 0.5 0.0 1.0 Locks the stop to breakeven once price travels this fraction toward target (0 = off).
Lots 0.10 0.01 1.0 Trade volume in lots per position.
harmonic octave reversion MT5 EA — MQL5 source code

Recommended Chart Settings

The Harmonic Octave Reversion strategy is designed to operate on a single timeframe and reads all of its data from the chart's primary symbol and period. Because it is a mean-reversion approach that depends on a well-defined trading frame, it tends to be studied most naturally on liquid instruments that spend meaningful time in balanced, range-bound conditions — major forex pairs are a common starting point for this kind of analysis.

Intraday and swing timeframes such as H1 or H4 offer a reasonable balance between having enough bars to build a stable frame and reacting to fresh probes of the extremes. That said, the octave grid and every filter are volatility-relative through ATR, so the strategy can be examined across a range of symbols and timeframes. Results will vary considerably across different market conditions, and any timeframe or symbol should be tested thoroughly before it is relied upon.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Every trading approach has strengths and trade-offs, and the Harmonic Octave Reversion strategy is no exception.

Strengths of this approach:

Known limitations of mean reversion:

This EA should be viewed as a structured framework for studying harmonic mean reversion, not as a finished solution. Thorough forward testing and an understanding of why each filter exists are essential before considering it in any live context.

Risk Management Tips

Sound risk management matters more than any single entry signal. Consider these general principles as you study this or any strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog