Here is my take on it. I've enjoyed seeing how others are approaching this.
Periods=Param( "Periods" , 10, 5, 252, 1);
DailyChg=ROC( C,1);
STD = StDev(DailyChg, Periods );
HV = STD*sqrt(252) ;
--- In amibroker@xxxxxxxxx ps.com, Potato Soup <potatosoupz@ ...> wrote:
>
> I'm trying to plot the 30 day historical volatility of the S&P 500, using the following AFL on a daily chart with around 2 years of end of day prices for the S&P 500:
>
> Plot(StDev(Close, 30),"Historical Volatility", colorOrange, styleLine) ;
>
> However when I look at the values, they appear to be a bit off to what I see when I look online here:
>
> http://www.ivolatil ity..com/options. j?ticker= SPX:CBOE& R=1&period= 12&chart= 2&vct=
>
> For today they have 18.99, where as my chart shows 19.348. All my other values going back further don't match their chart either. Any ideas, are they calculating it differently than just a simple standard deviation?
>