Loading…

Rogers Satchell Volatility

Close-to-close volatility (the simple standard deviation of returns) has a known flaw: a market that trends steadily in one direction without much bar-to-bar noise still generates a series of same-sign returns with real dispersion, which close-to-close volatility partly mistakes for "risk" rather than "drift". Rogers and Satchell (1991) solved this by building an estimator directly from all four OHLC prices per bar that is mathematically independent of drift - a steady trend does not inflate the reading, only genuine intrabar range does. Each bar's variance contribution is computed from the exact published formula: ln(H/C)*ln(H/O) + ln(L/C)*ln(L/O), where H, L, O and C are that bar's high, low, open and close. The indicator averages this term over InpWindow bars and plots the square root of that average - the Rogers-Satchell volatility estimate in the instrument's own price scale (or optionally annualised, see below). Because the formula uses each bar's own open and close as reference points rather than only the close-to-close change, it captures intrabar range information close-to-close volatility discards entirely. Notes and limitations - Uses the exact published Rogers-Satchell formula with no simplification - each bar needs a strictly positive open, high, low and close to take its logarithms; a bar failing that check (not expected on real MetaTrader history but cheap to guard against) is excluded from that window's average rather than treated as zero. - The per-bar variance term can occasionally compute a very small negative value on a near-zero-range bar due to floating point rounding in the two log-product terms; the running average is clamped at zero before the square root is taken so this never produces an invalid (NaN) reading. - Annualising with InpAnnualise uses a fixed calendar-minutes-per-year approximation (not a trading-days adjustment), so treat the annualised figure as a rough, comparable-across-timeframes scale rather than a precise annualised statistic. - Needs InpWindow + 1 bars of history before it starts plotting.

Indicator · MT5 · v1.0 · Free

About Rogers Satchell Volatility

Rogers Satchell Volatility is an indicator for MetaTrader 5. It has 2 settings, such as Window and Annualise. MQL source code included.

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

Settings

SettingDefaultWhat it does
Window20Bars averaged into each variance reading
AnnualisefalseScale to an annualised figure (sqrt(bars/year) rule)

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

MetaTrader 4 & 5 indicators · PolyMaria