(This is not the place for the following discussion. But I cannot
resist the temptation. Forgive me!)
JELLO said:
Take the natural log of the price change: LN(closing price/previous close)
Use as many price changes as you would like, i used 21 days.
Hmm, at first I wondered why you use so few data points.
Then it hit me: a one-month moving average, perhaps for
Bollinger bands? Oy!
Take the standard deviation of the natural log of all the
price changes...multiply this figure by the square root of
250 (this annualizes the volatility).
On second thought, there would be no need to annualize daily
volatility for Bollinger bands.
In any case, my point is: IMHO, 21 data points is far too few
for any serious understanding of daily price volatility -- unless
you have very small volatility to begin with.
Suppose you want to know the mean +/- 100% with 95%
confidence. With only 21 data points, that would mean that
volatility (sd) must be only 2.3 times the average [1].
I have not seen such low daily volatility, at least not in the
stock market. In fact, in one article available on the web [2],
during a 10-year period ending Jan 30 2004, the S&P500 had
a daily average change of 0.04% and a daily volatility of 1.14%.
Thus, the daily volatility was 28.5 times the average!
If that were based on just 21 data points, you would only know
the mean +/- 1225% (0.04 +/- 0.49) with 95% confidence. Even
with only 68% confidence, you would only know the mean +/- 625
(0.04 +/- 0.25)%. In contrast, the article relied on 2520 data
points to know the mean +/- 111% with 95% confidence
(0.04 +/- 0.0445).
I plan to use an advanced form of measuring volatility
(GARCH method)
GIGO, IMHO.
-----
Footnotes
[1] 100%*mean = 1.96*sd / sqrt(21) = 1.96*mean*x / sqrt(21)
x = mean*sqrt(21) / (1.96*mean) = sqrt(21) / 1.96
[2]
http://www.investopedia.com/printable.asp?a=/articles/04/021804.asp
states that the annual average return was 10.6% and the
annualized volatility was 18.1%. So the daily average return is:
(1 + 10.6%)^(1/252) = 0.04%
and the daily volatility is:
18.1% / sqrt(252) = 1.14%
That computed daily volatility matches the text of the article.