Loading…

Beta Percentile Tracker

A raw beta value on its own is hard to interpret. "Beta to EURUSD is 1.35" does not say whether that is normal for this symbol or a genuine regime shift - a pair that usually tracks the benchmark loosely and suddenly tracks it tightly (or the reverse) is more informative than the bare coefficient. This indicator measures rolling beta from the chart's own timeframe close-to-close returns over InpBetaLookback bars, then ranks today's beta reading against the last InpHistoryLookback beta readings, expressed as a percentile from 0 (lowest beta seen recently) to 100 (highest). A percentile near 50 means beta is behaving normally for this symbol; a reading pinned near 0 or 100 flags a correlation regime that is unusual even by the symbol's own recent standard, which a fixed beta threshold cannot express since "high beta" means something different for every symbol pair. Beta is recomputed from scratch for every historical bar rather than tracked incrementally, which is the honest way to avoid drift once the underlying window slides - the cost is a heavier first calculation pass on attach, not a correctness compromise. Notes and limitations - Requires InpBetaLookback + InpHistoryLookback + a few bars of history on BOTH the chart symbol and the benchmark before it plots anything; a freshly attached chart on a thinly-loaded benchmark symbol shows nothing for a few seconds while the benchmark's history syncs. - If the benchmark had zero return variance across a given window (a dead/illiquid symbol, or a data gap), that single beta reading is treated as undefined and excluded from the percentile rather than shown as a false zero. - Beta here is a simple single-factor regression slope over a rolling window on the chart's own timeframe - it is not annualised, not adjusted for a risk-free rate, and says nothing about statistical significance. - The percentile is purely descriptive (where beta sits in its own recent range), not predictive of what beta will do next. - Does not repaint: every plotted bar is a genuine closed-bar calculation, computed identically whether reached live or on chart load.

Indicator · MT5 · v1.0 · Free

About Beta Percentile Tracker

Beta Percentile Tracker is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Benchmark symbol, Beta lookback and History lookback. MQL source code included.

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

Settings

SettingDefaultWhat it does
Benchmark symbolEURUSDBenchmark symbol beta is measured against (must exist in Market Watch)
Beta lookback30Bars of trailing returns used to estimate each beta reading
History lookback250Number of past beta readings ranked against
Smooth period5SMA smoothing applied to the raw percentile line (1 = no smoothing)
AlertstrueAlert once per closed bar when the percentile 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: EURUSD · Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria