Loading…

Fractal Dimension Index

Fractal dimension asks a purely geometric question: how much does the price path wiggle per unit of horizontal distance it covers? A straight directional run has a dimension close to 1; a path that doubles back on itself constantly, filling space without going anywhere, approaches 2. This is a genuinely different measurement from a Hurst exponent or a variance-ratio test, both of which look at the statistical behaviour of RETURNS over time rather than the shape of the path itself - the two families are correlated in practice but are not the same thing, and this project exists to add the geometric version rather than another return-based one. The calculation follows the standard two-half construction: the lookback window is split into a newer half and an older half, the normalised high-low range is measured for each half and for the full window, and the dimension is D = (log(HL1 + HL2) - log(HL3)) / log(2). Splitting the window this way is what makes the statistic sensitive to roughness rather than just overall range - two halves that each cover as much range as the full window (constant retracement) push the ratio toward 2, while two halves that each cover half the full window's range (a straight run) push it toward 1. Notes and limitations - This is a description of the recently completed price path, not a forecast - a low reading says the recent past was directional, not that the next move will be. - A completely flat window (zero range) is parked on the neutral midpoint of 1.5 rather than left undefined, since the ratio itself is 0/0 in that case. - Complements rather than replaces choppiness or Hurst-style measures already in the catalogue - the three answer related but distinct questions and can disagree on the same chart.

Indicator · MT5 · v1.0 · Free

About Fractal Dimension Index

Fractal Dimension Index is an indicator for MetaTrader 5. It has 1 setting, such as Period. MQL source code included.

Files in the download: FractalDimensionIndex.ex5, FractalDimensionIndex.mq5, FractalDimensionIndex.txt.

Settings

SettingDefaultWhat it does
Period30Window analysed each bar - must be even, halved for the two sub-windows

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Fractals · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria