Blog / Strategy
Strategy

Capacitive Charge 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?

Capacitive Charge Reversion is a mean-reversion expert advisor (EA) for MetaTrader 5 that borrows a metaphor from electronics — the leaky capacitor — to decide when price has stretched too far from its own local equilibrium. A mean-reversion strategy assumes that when price drifts far from a fair-value baseline, it tends to be pulled back toward that baseline over time. Instead of relying on a conventional indicator such as RSI or Bollinger Bands, this strategy builds its own custom oscillator, called the charge, from first principles.

The core idea is to treat the distance between price and its recent average as a voltage, and to accumulate that voltage into a stored charge using a leaky integrator — a running total that also decays a little on every bar. A brief spike barely charges the system and quickly leaks away, which the strategy interprets as noise or genuine repricing. But price that stays persistently on one side of its baseline keeps pumping charge in faster than it leaks out, building a stored "reversion potential" that the strategy treats as primed to discharge back through equilibrium. When that charge crosses a self-calibrating threshold, the EA fades the move — selling into over-extended rallies and buying into over-extended declines.

This EA is best understood as a learning tool for traders who want to study adaptive, self-normalizing systems rather than fixed indicator levels. Because the baseline, the dispersion scale, and the trigger threshold are all recomputed on every bar, the strategy adapts to each symbol and timeframe with no hard-coded price levels. It is well suited to range-bound or oscillating market conditions and less suited to strong, sustained trends. If you are curious how signal processing concepts like integration, decay, and normalization can be applied to price data, this strategy is a compact and readable example.

How It Works

The strategy processes one closed bar at a time on the primary timeframe, so it never repaints or reacts to an unfinished candle. On each newly closed bar it recalculates its full state from scratch.

Here is what the strategy does step by step:

The strategy then signals entries and exits as follows:

Only one position is held at a time. After a position closes, the strategy waits for a later bar to generate a fresh signal.

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

Strategy Parameters

Parameter Default Min Max Description
Window 20 8 60 Number of bars used to compute the local equilibrium (mean) and the mean absolute deviation scale.
Decay 0.80 0.50 0.97 Leaky-integrator decay factor (lambda). Values closer to 1 retain charge longer; lower values leak faster and react more to recent bars.
ChargeWindow 100 30 300 Number of past charge values used to measure the charge's volatility for the self-calibrating threshold.
ThresholdMult 2.0 1.0 4.0 Multiplier (k) applied to the charge's standard deviation to set the entry threshold. Higher values require more extreme charge before signaling.
ExitFraction 0.30 0.0 0.80 Fraction of the threshold that defines the discharge exit band around zero. Larger values close positions sooner.
AtrPeriod 14 7 30 Number of bars used to calculate ATR for stop-loss and take-profit distances.
StopAtrMult 2.0 0.5 5.0 Stop-loss distance as a multiple of ATR.
TakeAtrMult 3.0 0.5 8.0 Take-profit distance as a multiple of ATR.
Lots 0.10 0.01 1.0 Fixed trade volume in lots for each position.
capacitive charge reversion MT5 EA — MQL5 source code

Recommended Chart Settings

Capacitive Charge Reversion is a single-timeframe strategy that reads the symbol and timeframe of the chart it is attached to. It was designed as a general-purpose mean-reversion study rather than for one specific instrument, so it is most instructive on markets that tend to oscillate around a value area — for example major forex pairs on intraday timeframes such as M15, M30, or H1.

Because every calculation is normalized and self-calibrating, the same default parameters can be applied to different symbols without manual re-scaling. That said, results will vary considerably across different market conditions, instruments, and broker data feeds. Always test the strategy on the exact symbol and timeframe you intend to study before drawing any conclusions, and expect its behavior to differ between quiet ranging periods and strong trending phases.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The main strength of this approach is that it is fully self-adapting. There are no fixed overbought or oversold levels to tune per symbol; the baseline, the dispersion scale, and the trigger threshold all recompute each bar from the market's own recent behavior. The leaky integrator is also a thoughtful way to distinguish a brief spike (which barely charges the system) from persistent one-sided drift (which accumulates), and the ATR-based stops keep risk proportional to current volatility.

The known limitations are inherent to any mean-reversion method. Fading extended moves works well when price oscillates around a value area, but it can struggle badly during strong, sustained trends — exactly the conditions where an "over-charged" reading may keep getting more extreme rather than reverting. In a powerful trend the strategy may repeatedly signal counter-trend entries that hit their stop-loss. The fixed lot size means position risk is not scaled to account equity, and the one-position-at-a-time design can leave the EA idle for long stretches. As with any parameter-driven system, there is also a risk of over-fitting if you tune the inputs too tightly to historical data.

Treat this EA as a framework for studying adaptive mean reversion, not as a finished, drop-in solution.

Risk Management Tips

Sound risk management matters more than any single signal rule. Consider these general principles as you study the 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