Skip to content
All library documents

Comparing OHLC Volatility Estimators and Building Gap-Aware Bands

Article MQL5 articles

Summary

This article explains four historical volatility estimators that use different portions of each bar’s OHLC data: close-to-close, Parkinson, Garman-Klass, and Yang-Zhang. Close-to-close uses only closing prices, while the range-based alternatives incorporate intrabar highs and lows. Parkinson and Garman-Klass can be more statistically efficient under their assumptions, but they omit overnight gaps; Yang-Zhang combines overnight returns, open-to-close returns, and a drift-aware intrabar term to address both gaps and drift.

The author presents a reusable rolling-window library and two MetaTrader 5 indicators: one compares the estimators and the other draws bands scaled by Yang-Zhang volatility. The discussion offers relative efficiency estimates and describes the assumptions behind each method, rather than reporting a controlled trading-performance test. Yang-Zhang is recommended for markets with session gaps, while Garman-Klass may be similar on near-continuous markets. These are volatility measurement tools; their usefulness for trading decisions still depends on the instrument, sampling window, and application.

Key ideas

  • OHLC bars contain intrabar range information that close-to-close volatility estimates discard.
  • Parkinson and Garman-Klass use high-low data efficiently but can miss gaps and assume no drift.
  • Yang-Zhang incorporates overnight returns and a drift-aware intrabar term to handle gaps and drift.
  • A rolling-window implementation can expose multiple estimators through a shared library.
  • The article applies Yang-Zhang volatility to indicator bands but does not establish their trading profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.