Blog / Strategy
Strategy

Self Exciting Momentum Cluster

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 Self Exciting Momentum Cluster is a momentum and trend-following strategy for MetaTrader 5 built on a Hawkes self-exciting point process — the same branch of mathematics used to model earthquake aftershocks and bursts of order-flow in financial markets. Instead of measuring how big volatility is (the job of Bollinger Bands, Keltner Channels or a raw ATR expansion filter), it measures how clustered directional shocks have become, and it uses that clustering as both the trigger to enter and the direction to trade.

The core observation behind the strategy is that large directional moves are not independent of one another. One strong up-bar tends to make the next strong up-bar more likely — buying begets buying, protective stops cascade, and momentum-chasing participants pile in. In statistics, "an event that raises the probability of more same-kind events" is precisely the definition of a self-exciting process. The strategy tracks two directional "intensities," one for up-shocks and one for down-shocks. Each intensity jumps when a fresh shock fires and then decays geometrically between shocks, so the signal stays alive only while the herd behaviour is genuinely ongoing.

As a learning tool, this EA is well suited to traders who already understand basic indicators like the ATR (Average True Range, a measure of typical price movement) and the EMA (Exponential Moving Average, a trend baseline) and who want to explore a more advanced, research-flavoured way of thinking about momentum. It is designed for trending markets where directional bursts genuinely cluster, and it is best studied as an analysis of clustering behaviour rather than treated as a shortcut to results.

How It Works

The strategy processes one completed bar at a time and maintains a running pair of intensities that together form a single net intensity, called Lambda (lambda_up − lambda_down). Here is the logic in plain English:

self exciting momentum cluster EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
EventThreshold 0.70 0.30 2.00 A bar counts as a directional shock when the price change exceeds this multiple of ATR. Lower values make more bars count as shocks.
Decay 0.85 0.60 0.97 Per-bar geometric decay of both intensities; effectively the memory length of a cluster. Higher values remember shocks longer.
Excitation 1.00 0.30 2.00 The size of the intensity jump added on each shock (the self-excitation strength).
IgnitionLevel 1.60 0.60 4.00 The net-intensity band edge that Lambda must cross to declare an ignition (entry trigger).
TrendEmaPeriod 50 20 200 Period of the slower EMA that defines the regime the ignition must agree with.
AtrPeriod 14 7 30 ATR length used for the shock threshold and for stop, target and trailing distances.
AtrSlMult 1.60 0.50 4.00 Stop-loss distance in ATR multiples; also defines the 1R risk unit.
AtrTpMult 3.20 1.00 6.00 Take-profit distance in ATR multiples.
AtrTrailMult 1.80 0.50 4.00 Trailing-stop distance in ATR multiples, applied once a trade is past +1R.
Lots 0.10 0.01 1.00 Fixed position size in lots.
Magic 5711 0 9,999,999 Unique identifier the EA uses to manage only its own trades.
self exciting momentum cluster EA — MQL5 source code

Recommended Chart Settings

The Self Exciting Momentum Cluster is timeframe-agnostic because every threshold is normalised by ATR, but it was designed with trending instruments in mind. A sensible starting playground is a trending FX major or a metal — for example EURUSD or XAUUSD (gold) — on the M30 or H1 timeframe, where directional bursts tend to cluster clearly enough for the Hawkes intensities to build meaningful signals.

Because the strategy runs on whichever timeframe you attach it to, you can experiment across different charts. Keep in mind that behaviour, signal frequency and results will vary considerably across symbols, timeframes and market conditions, so any settings that look reasonable on one instrument should be re-examined on another before you draw conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Like any approach, this strategy has genuine strengths and real limitations, and it is worth weighing both honestly.

Where the approach is interesting. The self-exciting design elegantly folds trigger and direction into a single number, so you are not stacking multiple oscillators that can disagree. Because shocks are ATR-normalised, the same parameter set behaves consistently across symbols and timeframes without manual retuning. The Trend-EMA filter helps avoid taking clusters that fight the larger regime, and the layered exits — dissipation exit, stop-and-reverse, break-even and ATR trail — are all aimed at keeping drawdown shallow rather than maximising any single trade.

Known limitations. Self-exciting momentum logic is, by construction, a trend-and-continuation tool. In choppy, range-bound or mean-reverting conditions, clusters can ignite and then dissipate quickly, producing whipsaw entries that the dissipation exit closes at a small loss. The strategy also acts once per closed bar for its signals, so it will not react intrabar to sudden reversals except through the tick-by-tick trailing stop. Parameters such as Decay and IgnitionLevel interact in subtle ways — a longer memory paired with a low ignition band can keep the strategy in trades longer than intended, while the opposite combination may rarely trigger at all.

When it may underperform. Expect weaker behaviour during low-volatility drift where no bar clears the shock threshold, during news-driven spikes that reverse immediately, and in sideways markets that repeatedly cross the EMA. This is a strategy to study and stress-test, not to assume will suit every environment.

Risk Management Tips

Sound risk management matters more than any single indicator. As general educational principles:

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