Historical or Implied Volatility Measure

Dear Sir,

Please advice how to identify Historical or Implied Volatility of a stock in your AmiBroker software.
Have u any indicator or AFL Coding regarding measure Volatility of a particular stock.
Kindly guide or advice where I find the volatility measure.

https://www.google.com/search?q=Historical+Volatility+Calculation

e.g.

period = 60;
hist_vola = StDev(log(C/Ref(C,-1)), period) * 100 * sqrt(250);
8 Likes

Thanks fxshrat! I was looking for that!. Is there a similar AFL Plot but for Implied Volatility? I found other threads related but neither plot Volatility Lineon Chart on chart.
Best,

This formula seems to produce quite different results than those given by www.finviz.com. From their documentation "Volatility is in finance represented by the standard deviation computed from the past (historical) prices." So, it seems like they are using standard deviation to calculate volatility.

When I calculate the weekly volatility I use a period of 5, and for monthly a period of 21. Finviz reports a weekly volatility of 0.80 and 0.75 for monthly as of the close of 12/8/23 for SPY. Using the above calculation in Amibroker I get 0.49 for weekly and 0.62 for monthly. For XLK finviz reports 1.34% for weekly and 1.15% for monthly whereas the above Amibroker formula shows 0.97 for weekly and 0.91 for monthly.

If they are both using standard deviation to calculate the volatility, why the big differences? What is the formula finviz is using? Does anyone know? I would like to be able to do calculations that would match those done by finviz.

Thanks

I tried a number of different calculations to duplicate HV on the finviz web site starting with standard deviation, but that did not get me close. It seems finviz is not using standard deviation despite what their web site docs say. Here is the calculation that gets me the closest.

HV = 100 * MA(H-L, Range) / MA(C, Range) + 0.01;

I had to add 0.01 to improve results. Many calculations are now dead on, but a few are still off by 0.01. I assume the differences are a result of rounding, but haven't been able to get an exact match on every symbol. Using Range = 5 for weekly, and Range = 21 for monthly.