Loading…

Parkinson And Garman-Klass Volatility

Close-to-close volatility only looks at where each bar ended. It throws away everything the bar's own high and low already told you about how far price actually travelled during that bar - two bars can close at the same price after very different amounts of intrabar movement, and plain standard deviation cannot tell them apart. Parkinson's estimator fixes this using the high-low range alone, scaled by a constant derived from the range of a continuous random walk. It is roughly five times more statistically efficient than close-to-close for the same sample size, meaning it needs a much shorter window to reach the same precision. Garman-Klass goes further, adding the open-close leg on top of the range term, capturing more of the bar's genuine path - at the cost of assuming price does not jump between the close of one period and the open of the next. All three measures are plotted together over the same rolling window so the difference is visible rather than asserted: watch how much steadier the two range-based lines usually sit compared to the noisier close-to-close line, particularly on choppy intrabar action that closes flat. Notes and limitations - Garman-Klass assumes no gap between one bar's close and the next bar's open. On forex weekend gaps or an index's opening gap, it will understate true volatility for that specific bar; Parkinson, which never looks at the close at all, is unaffected by that particular assumption but shares the same limitation of ignoring drift. - Both estimators are biased slightly low versus true instantaneous volatility because they are built from discretely sampled high/low data, not continuous price paths; this is a known, accepted property of both formulas, not a bug in this implementation. - Expressed in native per-bar percentage terms, not annualised, since annualising needs assumptions about trading days that vary by broker and symbol. - This describes volatility, not direction. It does not size a position or place a stop.

Indicator · MT4 · v1.0 · Free

About Parkinson And Garman-Klass Volatility

Parkinson And Garman-Klass Volatility is an indicator for MetaTrader 4. It has 1 setting, such as Period. MQL source code included.

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

Settings

SettingDefaultWhat it does
Period20Rolling window, in bars, for all three estimators

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: MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria