Loading…

Momentum Percentile Rank

A raw momentum reading in price units is hard to interpret on its own. Forty pips of momentum is unremarkable on a volatile pair in a fast market and unusually strong on a quiet one in a calm week, and the same symbol's own typical momentum range drifts as volatility regimes change. A fixed overbought/oversold threshold on raw momentum quietly stops meaning the same thing over time. This indicator sidesteps that by never comparing the current reading to a fixed number at all. Instead it takes today's N-bar momentum and asks what percentage of the last several hundred momentum readings on this same symbol and timeframe were smaller. The output is always 0-100 by construction, and a reading near 100 always means "about as strong as this instrument's momentum gets", whatever the underlying price units happen to be - the same interpretation whether it is attached to a forex pair, a metal, or an index CFD. The percentile is computed by direct comparison against every reading in the lookback window rather than an assumed distribution shape, so it stays honest on skewed or fat-tailed momentum distributions where a z-score-style normalisation would understate how extreme a reading really is. Notes and limitations - Needs InpMomPeriod + InpLookback bars of history before it plots anything; on a freshly opened chart with thin history it stays blank until enough bars are available. - The ranking is entirely relative to the chosen InpLookback window - a reading of 90 on a 500-bar lookback is not directly comparable to a reading of 90 on a 2000-bar lookback computed on the same data. - Computation cost scales with InpLookback since each bar's percentile compares against every reading in the window; very large lookback values on a long history can make the initial calculation noticeably slower to complete, though it still finishes well within MetaTrader's normal indicator load time.

Indicator · MT5 · v1.0 · Free

About Momentum Percentile Rank

Momentum Percentile Rank is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Mom period, Lookback and Alerts. MQL source code included.

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

Settings

SettingDefaultWhat it does
Mom period14Bars back the raw momentum is measured against
Lookback500Number of past momentum readings ranked against (long history, not a short window)
AlertstrueAlert once per closed bar when the rank crosses 10 or 90

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: Momentum · Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria