Discussing the article: "From One Price to Four: Range-Based Volatility Estimators for MetaTrader 5"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: From One Price to Four: Range-Based Volatility Estimators for MetaTrader 5.
Close-to-close volatility ignores the high, the low, and overnight gaps. We build a reusable MQL5 library implementing four range-based estimators from Parkinson to the gap-robust Yang-Zhang, and put it to work in a comparison indicator and a set of adaptive volatility bands.
Almost every volatility tool a MetaTrader 5 user reaches for is built on one value per bar. Bollinger Bands take the standard deviation of closing prices. The Average True Range is closer in spirit to what we want, but it is a smoothing of a range, not a variance estimate, and it is rarely treated as one. Meanwhile every bar the terminal draws contains four prices: open, high, low, and close, and the intrabar high and low carry a great deal of information about how much the price actually moved. Discarding them is a measurable waste.
The academic literature settled this question decades ago. A family of range-based estimators, beginning with Parkinson in 1980 and refined by Garman and Klass the same year, then by Rogers and Satchell, and finally by Yang and Zhang in 2000, extracts far more information from the same bars. For a given window length, a good range estimator reaches the same statistical precision as close-to-close using a fraction of the data, or equivalently, it produces a far smoother, more responsive volatility series from the window you already have. Yet MetaTrader 5 does not provide them as standard indicators, and the CodeBase lacks a clean, reusable implementation of this classic family: a search turns up GARCH models and basic ATR, but nothing that packages Parkinson, Garman-Klass and Yang-Zhang behind one interface.
In this article we close that gap. We build a single, self-contained library, VolatilityEstimators.mqh, implementing four estimators, from the naive baseline to the most sophisticated. We then use it to build two indicators. The first is a comparison panel that plots all four together, so you can see the efficiency difference on your own charts. The second is a practical tool: volatility bands sized by the gap-robust Yang-Zhang estimator instead of a standard deviation of closes. By the end you will understand what each estimator measures, why they differ, when each one is the right choice, and you will have working code you can drop into your own projects.
Author: Adeolu Kayode Gbadebo