Blog / Strategy
Strategy

Higuchi Dimension Regime Trend

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 Higuchi Dimension Regime Trend strategy is a regime-gated trend-following Expert Advisor (EA) that uses the Higuchi fractal dimension — a mathematical measure of how "rough" or "smooth" a price curve is — to decide when momentum signals are worth acting on. Its trading style is classic trend following, but with an unusual filter bolted on the front: instead of asking "is price moving up or down?", it first asks "is the market currently smooth enough to trend at all?"

The idea comes from fractal geometry. Higuchi's 1988 algorithm estimates the fractal dimension (FD) of a time series by measuring how the total length of the price path grows as you re-sample it at coarser and coarser strides. The result is a single number, bounded between 1.0 and 2.0. When the FD sits near 1.0, the price path is smooth and nearly straight — the geometric signature of a persistent trend. When the FD climbs toward 2.0, the path is jagged and space-filling — the signature of choppy, mean-reverting noise where momentum entries tend to fail. This is a genuinely different measurement than a moving-average slope, an efficiency ratio, or a Hurst exponent, because it reads the shape of price directly.

As a learning tool, this strategy is well suited to traders who already understand basic trend following and want to study how a regime filter changes an EA's behaviour. By pairing a simple EMA-cross trigger with a fractal "trend versus chop" gate, it offers a clear, self-contained example of how quantitative regime detection can be layered on top of an ordinary entry rule. It is designed for educational study rather than as a profit opportunity.

How It Works

The strategy acts once per bar, evaluating only completed candles so that signals do not repaint. On each new bar it measures the market's roughness, checks its direction trigger, and then either stands aside or trades.

Because both the trend gate and the direction trigger must agree, the strategy signals relatively infrequently. That selectivity is by design: the fractal filter is meant to keep the EA out of the ranging conditions where an EMA cross alone tends to whipsaw.

Higuchi fractal dimension MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
FdLookback 40 20 120 Number of completed closes fed to the Higuchi fractal-dimension estimator. Larger values read a longer stretch of the price curve.
Kmax 6 3 12 Maximum re-sampling stride used to build the length-versus-scale curve. Controls how many scales the fractal estimate averages over.
TrendThreshold 1.45 1.20 1.80 The strategy trades only when the fractal dimension is at or below this value. Lower means "insist on a smoother, cleaner trend."
EmaPeriod 21 8 80 Period of the baseline EMA whose close-cross provides the direction trigger.
AtrPeriod 14 5 40 Lookback window for the ATR used to size the stop and target.
StopAtrMult 2.0 0.5 5.0 Stop-loss distance expressed as a multiple of ATR.
TargetAtrMult 3.0 0.5 8.0 Take-profit distance expressed as a multiple of ATR.
Lots 0.10 0.01 1.0 Fixed order volume in lots per trade.
Higuchi fractal dimension MT5 EA — MQL5 source code

Recommended Chart Settings

The Higuchi Dimension Regime Trend EA is single-timeframe: every calculation is read from the chart's own timeframe, so it runs on whatever timeframe you attach it to. The default parameters — a 40-bar fractal window, a 21-period EMA, and a 14-period ATR — are a sensible starting point for a major forex pair on an intraday timeframe such as H1 or H4, where trend-and-chop cycles are pronounced enough for the fractal gate to add value. Higher timeframes generally produce fewer but cleaner signals, while lower timeframes generate more noise that the fractal filter must work harder to reject.

There is no universally "correct" symbol or timeframe. The fractal dimension responds to the character of each instrument, so results will vary considerably across pairs, sessions, and market regimes. Always test any configuration on your own data before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The main strength of this approach is its regime awareness. Most simple EMA-cross systems trade in all conditions and bleed capital during range-bound markets, where crosses cluster and reverse quickly. By requiring a low fractal dimension before acting, the Higuchi Dimension Regime Trend strategy is built to sit out precisely those conditions. The fractal dimension is also a mathematically distinct lens on the market — it does not simply restate what a moving average already tells you — which makes it interesting to study alongside more familiar filters.

There are real limitations to weigh honestly, though. The fractal dimension is a lagging, backward-looking statistic: it describes the roughness of the window that has already closed, so a regime can shift after the gate has opened. The TrendThreshold is a single hard cutoff, and markets near that boundary can flicker in and out of "trending" status, producing missed signals or late entries. Because the strategy is selective, it may go long stretches without trading, which can be psychologically difficult and makes performance sensitive to a small number of trades. It can also underperform in fast, gappy, or news-driven markets where the fractal estimate and the EMA cross disagree, and in strongly trending conditions the stop-and-reverse logic can occasionally flip out of a good position on a brief counter-signal.

As with any regime filter, the parameters interact. A very low threshold produces few, high-conviction signals; a higher one lets more marginal trends through. Neither is inherently better — the right balance depends on the instrument, timeframe, and your own risk tolerance, and it should be discovered through careful testing rather than assumed.

Risk Management Tips

Sound risk management matters more than any single indicator. Consider these general principles as you study this EA:

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