Loading…

Trend Age And Maturity Gauge

"This trend has run a long way already" is a judgement traders make by eye, usually too late. This indicator replaces the eyeball with a measurement: it finds confirmed swing pivots using a symmetric fractal test, treats the run between two consecutive pivots as a "leg", and builds a trailing sample of how long (in bars) and how far (in price) this instrument's legs have typically run. The leg currently in progress - from the last confirmed pivot to right now - is then given a percentile rank against that sample on both measures. A leg sitting at the 90th percentile for age, distance, or both has already outlasted or outrun nine out of ten of its own recent predecessors on this instrument and timeframe. That does not mean it has to end this bar, but it does mean the base rate has shifted - late-cycle legs are exactly the ones a fresh trend-following entry tends to get caught by. The gauge reports this as two percentile lines plus a plain-language panel label rather than a single blended score, because age and distance can disagree (a slow grind can be old without being far, a spike can be far without being old) and collapsing that distinction away would hide the more useful half of the read. The pivot scan only re-runs once per closed bar, since a fractal pivot cannot newly confirm mid-bar, keeping the indicator light on a live chart despite scanning back over InpLookbackBars bars. Notes and limitations - Like every fractal-based pivot detector, the most recent InpSwingBars bars of pivot state are provisional and can still revise as new bars close - this affects which bar is treated as the "last confirmed pivot," not the historical leg sample it is compared against. - The percentile distribution is drawn only from this chart's own recent legs; a young chart or an illiquid symbol with few confirmed pivots produces a thin, noisier sample. - This describes how the current leg compares with recent history, it does not forecast when the leg will end. - Buffers only carry a value on the bar where they were computed live and freeze there - the tool is a current-state gauge, not a backfilled historical percentile series.

Indicator · MT4 · v1.0 · Free

About Trend Age And Maturity Gauge

Trend Age And Maturity Gauge is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 9 settings, such as Swing bars, Lookback bars and Leg sample. MQL source code included.

Files in the download: TrendAgeMaturityGauge.ex4, TrendAgeMaturityGauge.mq4, TrendAgeMaturityGauge.txt.

Settings

SettingDefaultWhat it does
Swing bars5Bars required on each side to confirm a swing pivot
Lookback bars1000How far back to search for pivots
Leg sample30Completed legs kept for the percentile distribution
Late threshold80.0Percentile at/above which the leg is flagged late
AlertstrueAlert once when either percentile crosses the threshold
CornerCORNER_LEFT_UPPERPanel corner
X distance10Panel horizontal offset, pixels
Y distance20Panel vertical offset, pixels
Font size10Panel font size

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 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: Pivot Points · Fractals · Trend · Trailing Stop & Break-even · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria