Yang–Zhang Volatility: Comparing Sinclair’s Formula with TTR
Summary
The document compares the Yang–Zhang volatility estimator as presented in Euan Sinclair’s book with the implementation in the TTR package. It focuses on the open and close variance terms: the book’s displayed formulas use open-to-open and close-to-close returns, while TTR uses overnight open-to-previous-close returns and intraday close-to-open returns. The question is whether the discrepancy is a typo.
The answer consults the original Yang–Zhang paper, which defines normalized open and close returns using those overnight and intraday intervals. From that definition, the answer derives the open variance used by TTR and says the close term follows the same logic. It concludes that TTR matches the original estimator and that Sinclair’s book appears to contain mistakes. The document mentions a chart where the book’s version seems to produce higher volatility, but gives no chart data or independent performance analysis. The comparison concerns formula definitions; it does not establish how either estimator behaves across markets or sampling choices.
Key ideas
- The original Yang–Zhang estimator defines the open return from the previous close to the current open.
- The normalized close return runs from the current open to the current close.
- TTR’s variance terms follow these definitions from the original paper.
- The answer interprets Sinclair’s differing formulas as likely errors in the book.
- A chart is mentioned as showing divergence, but the document provides no underlying data for assessing it.
Tags
Full text
# Volatility formulas in Sinclair's "Volatility Trading" book differs from TTR
# Volatility formulas in Sinclair's "Volatility Trading" book differs from TTR
In "Volatility Trading" Euan Sinclair defines Yang-Zhang volatility estimator as
$$ \sigma = \sqrt{\sigma^2_o + k\sigma^2_c + (1-k)\sigma^2_{rs}} $$
where $$ \sigma^2_o \propto Variance\left(ln\left(\frac{o_i}{o_{i-1}}\right)\right) $$ $$ \sigma^2_c \propto Variance\left(ln\left(\frac{c_i}{c_{i-1}}\right)\right) $$ $$ \sigma^2_{rs} = \frac{1}{N} \sum_{i=1}^N \left( \left(ln \frac{h_i}{c_i}\right) \left(ln \frac{h_i}{o_i}\right) + \left(ln \frac{l_i}{c_i}\right) \left(ln \frac{l_i}{o_i}\right) \right) $$
/* I'm using $\propto$ symbol as "proportional to" to avoid unbiasing the $Variance$ via multiplying $Variance$ by $\frac{N}{N-1}$. See the actual formulas on the screenshot below in the References. */
However, TTR package 1 uses different formulas for $\sigma_o^2$, $\sigma_c^2$:
$$ \sigma^2_o \propto Variance\left(ln\left(\frac{o_i}{c_{i-1}}\right)\right) $$ $$ \sigma^2_c \propto Variance\left(ln\left(\frac{c_i}{o_{i}}\right)\right) $$
I plotted Garman-Klass, Parkinson, Yang-Zhang (TTR and Sinclair's) estimators on a chart:
It shows how Sinclair's Yang-Zhang definition systematically deviates (and overestimates?) the volatility compared to the rest of the estimators.
Question
Does Sinclair's formula have a typo?
References
- TTR volatility documentation
- Yang-Zhang volatility estimator from Sinclair's book: screenshot
## Answer by Pleb (score 4, accepted)
https://quant.stackexchange.com/a/71803
### When in doubt, consult the original paper :
In the beginning of the paper, the authors describe the following definitions for the normalized open and close (p. 479):
\begin{align*} o&=\ln(O_1) - \ln(C_0) = \ln\left(\frac{O_1}{C_0}\right), \quad \text{normalized open;}\\ c&=\ln(C_1) - \ln(O_1)= \ln\left(\frac{C_1}{O_1}\right), \quad \text{normalized close.} \end{align*}
Furthermore in Section II they define their volatility estimator as (pp. 482 - 488):
\begin{align*} V &= V_O + k \cdot V_C + (1-k) \cdot V_{RS}\\ V_O&= \frac{1}{n-1}\sum_{i=1}^n (o_i - \bar{o})^2\\ V_C&= \frac{1}{n-1}\sum_{i=1}^n (c_i - \bar{c})^2\\ \bar{o}&=\frac{1}{n}\sum_{i=1}^n o_i\\ \bar{c}&=\frac{1}{n}\sum_{i=1}^n c_i,\\ \end{align*} where $V_{RS}$ is derived later in the paper. Writing out one of the variance measures — using the notation from the original paper — gives you a clear indication that the `TTR` package has defined the Yang-Zhang estimator as originally intended: \begin{align*} V_O&= \frac{1}{n-1}\sum_{i=1}^n (o_i - \bar{o})^2\\ &=\frac{1}{n-1}\sum_{i=1}^n \left(o_i - \frac{1}{n}\sum_{i=1}^n o_i\right)^2\\ &=\frac{1}{n-1}\sum_{i=1}^n \left(\ln\left(\frac{O_i}{C_{i-1}}\right) - \frac{1}{n}\sum_{i=1}^n \ln\left(\frac{O_i}{C_{i-1}}\right)\right)^2\\ &=V_O^{\text{TTR}}. \end{align*} You can do the same derivation for $V_C$. Yes, I believe Sinclair has a few mistakes in his book.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.