Opens in a new tab
Fractal Graph Dimension Indicator MT5

The Fractal Graph Dimension Indicator (FGDI) is a free instant-download tool for MetaTrader 5 that measures how “trendy” versus how “random” recent price action has actually been, using fractal dimension math rather than a moving average or a momentum formula. Instead of telling you which direction the market might go, it tells you whether the market is currently behaving like a genuine trend or like a random walk — a distinction that matters a great deal for deciding whether a trend-following approach even makes sense right now.

What FGDI Actually Calculates

For each bar, the code first finds the highest and lowest price over the last e_period bars (30 by default). It then normalizes every price in that window to a 0–1 scale between that high and low, and measures the total “path length” of the normalized price line by summing the distance between each consecutive normalized point (using a Euclidean-style distance that also factors in the fixed horizontal spacing between bars, 1/e_period²). A price series that moves in one clean direction produces a short path length relative to its window; a choppy, back-and-forth series produces a much longer path length for the same window.

That path length feeds directly into the fractal dimension formula: FDI = 1 + (ln(length) + ln(2)) / ln(2 × (e_period − 1)). The result is bounded roughly between 1.0 (a nearly straight, strongly trending line) and 2.0 (a maximally choppy, random-walk-like line). The code also computes the variance of the path’s segment lengths around their mean, takes its square root as a standard deviation, and plots FDI + stddev and FDI − stddev as the “+2Sigma” and “-2Sigma” band lines around the main Fdi line, giving a visual sense of how stable that dimension reading has been within the window.

How to Read It

The e_random_line input (1.5 by default) marks the theoretical midpoint between a pure trend and a pure random walk, and is plotted as a dashed horizontal reference level. The main Fdi line and both sigma bands change color (blue above the random line, red at or below it) so you can see at a glance whether the current window’s dimension reading sits on the “trending” or “random” side of that boundary. Because the calculation is a window statistic rather than a directional signal, FGDI is typically used as a filter: many traders only trust trend-following entries (breakouts, moving average crosses) when Fdi is reading below the random line, and treat signals generated while Fdi sits above it — meaning the market has been behaving more like noise than trend over the lookback window — with more caution.

Key Input Parameters

  • e_period (30): the lookback window, in bars, used to compute both the path length and the resulting fractal dimension.
  • e_random_line (1.5): the reference threshold between trending and random-walk behavior, plotted as a dashed level and used to color the line and bands.
  • IPC (PRICE_CLOSE): the applied price series the fractal dimension calculation is run against.
  • Shift (0): shifts the indicator’s plotted lines horizontally by the given number of bars.

Why the Math Matters

Fractal dimension is a concept borrowed from measuring the “roughness” of a geometric curve, and applying it to a price series is a specific attempt to quantify something ADX and similar trend-strength tools only approximate indirectly. Where ADX derives strength from smoothed directional movement, FGDI derives it from the literal geometric path length of normalized price — a series that travels in a straight diagonal line across the window has the shortest possible path and produces an Fdi near 1.0, while a series that zig-zags back and forth across the same vertical range covers far more ground and pushes Fdi toward 2.0. This is why the indicator’s original author (jppoton, whose blog is credited in the file header) built it specifically as a standalone trending-versus-random-walk diagnostic rather than as a signal generator with its own entries.

Honest Limitations

FGDI needs at least e_period + 1 bars of history before it will calculate at all (the code explicitly returns early otherwise), and because the fractal dimension formula divides by the logarithm of the window size, very small e_period values can produce unstable readings. The indicator also has a documented quirk in its own comments: when the price window is completely flat (highest equals lowest, so the path length can’t be computed), the code deliberately falls back to the previous bar’s Fdi value rather than forcing a zero reading, which the original author notes explicitly in the source. FGDI carries no alerts and generates no buy/sell arrows — it is purely a background filter for trend-strength conditions, and its output should be read alongside an actual entry method rather than on its own.

Download the Fractal Graph Dimension Indicator MT5
  • e_period (default 30) — Lookback window, in bars, used to compute the path length and resulting fractal dimension.
  • e_random_line (default 1.5) — Reference threshold between trending and random-walk behavior, plotted as a dashed level.
  • IPC (default PRICE_CLOSE) — Applied price series the fractal dimension calculation is run against.
  • Shift (default 0) — Horizontal shift of the plotted lines, in bars.

FAQs About the MT4 Fractal Graph Dimension Indicator MT5

Fractal Graph Dimension Indicator MT5

The Fractal Graph Dimension Indicator (FGDI) is a free instant-download tool for MetaTrader 5 that measures how "trendy" versus how "random" recent price action has actually been, using fractal dimension math rather than a moving average or a momentum formula. Instead of telling you which direction the market might go, it tells you whether the…

Download the Fractal Graph Dimension Indicator MT5

One Quick Step

Enter your name and email and check your inbox for the download link.