Polarized Fractal Efficiency
Two instruments can move the identical net distance over the identical number of bars while one does it in an almost straight diagonal line and the other thrashes up and down the whole way to get there - a plain rate-of-change measure cannot tell them apart, since it only sees the net displacement. Polarized Fractal Efficiency measures the difference directly: it computes the straight-line distance between the close N bars ago and today's close (via Pythagoras, treating one bar as one unit of horizontal distance), then compares that against the actual path length - the sum of the true bar-to-bar distances price walked to get there. A price that moved efficiently has a path length close to the straight-line distance (efficiency near 100%); a price that thrashed sideways covers a long path for a small net move (efficiency near 0%). The "polarized" half of the name is the sign: the ratio itself is naturally unsigned (a fraction of the path that was net progress), so the formula signs it by the direction of the net move over the window - positive for a net rise, negative for a net fall - so up-moves and down-moves plot on opposite sides of zero rather than needing a separate direction indicator alongside it. The raw signed ratio is then run through a short EMA, since the unsmoothed version is noisy bar to bar even when the underlying efficiency is genuinely stable. Notes and limitations - The straight-line distance treats one bar as one unit of horizontal distance, matching Hannula's original published formula; this makes the raw ratio's exact numeric scale a function of the chosen period, which is why it is read as a bounded percentage rather than compared directly across different InpPeriod settings. - A completely flat run of identical closes produces a path length equal to InpPeriod (one unit of horizontal distance per bar, no vertical movement) and a straight-line distance of InpPeriod as well, so efficiency correctly reads 100% even with literally zero net price change - it is measuring the SHAPE of the path, not its distance. - Like any efficiency-ratio indicator, high efficiency describes a move that already happened; it does not forecast whether the current efficient stretch continues or reverses next.
Indicator · MT4 · v1.0 · Free
About Polarized Fractal Efficiency
Polarized Fractal Efficiency is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Period, Smooth period and Alerts. MQL source code included.
Files in the download: PolarizedFractalEfficiency.mq4, PolarizedFractalEfficiency.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 10 | Bars back for the straight-line/path comparison |
| Smooth period | 5 | EMA smoothing period applied to the raw efficiency |
| Alerts | true | Alert once per closed bar on a zero-line cross |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Fractals · Alerts · MT4 Indicator · MQL4 Source Code