Loading…

Extreme Day Frequency Gauge

A single volatility reading tells you how big moves have been on average. It does not tell you whether extreme moves are clustering. A handful of genuinely violent bars barely nudges a mean or an ATR reading, but they show up immediately in a count of how often the market has recently exceeded its own normal range. This indicator classifies each closed bar as "extreme" if its log return exceeds InpSigmaThreshold standard deviations of that SAME bar's own trailing baseline - the sigma is built from the InpSigmaWindow bars strictly before it, never including the bar's own return, so an already- volatile stretch cannot inflate the threshold used to judge itself. The plotted histogram is then the rolling count of extreme bars over the last InpCountWindow bars. A horizontal reference level shows the count that a normal distribution would produce for the chosen threshold and window, computed from a closed- form normal-tail approximation (MQL4 has no built-in error function, so this uses the standard Zelen and Severo polynomial approximation). A reading sitting well above that level means tail events are clustering more than a normal model would predict - the kind of regime a fixed position size or a fixed stop distance handles badly. Notes and limitations - Non-repainting: every bar's classification depends only on its own return and the returns strictly before it. - The reference level is a fixed number derived only from the inputs (InpCountWindow and InpSigmaThreshold); it does not itself update per bar or per symbol. - Uses close-to-close log returns on the chart's own timeframe. Applied to a daily chart, "extreme day" is a literal daily reading; on any other timeframe it means "extreme bar" for that period instead. - This counts frequency of tail events, not their direction or size beyond the threshold - it does not distinguish a barely-qualifying bar from a wildly extreme one.

Indicator · MT4 · v1.0 · Free

About Extreme Day Frequency Gauge

Extreme Day Frequency Gauge is an indicator for MetaTrader 4. It has 3 settings, such as Sigma window, Sigma threshold and Count window. MQL source code included.

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

Settings

SettingDefaultWhat it does
Sigma window50Bars used to build each bar's own trailing baseline sigma
Sigma threshold2.0Return must exceed this many sigma to count as extreme
Count window20Rolling window (bars) the extreme-day count is taken over

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: ATR · Trailing Stop & Break-even · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria