Recently came across a document that describes NSE's formula to compute volatility which is a kind of weighted average of two values.
The most accurate AFL (that I can come up with ) for the same is
Just as I had expected, Ami does not like this and whines about having to use variable without initializing it first . Fair Enough !!!
One minor correction transforms Ami into being happy,
Nevertheless, this correction leaves me wondering on how I could actually bootstrap the nseDailyVolatility array.
I want to initialize the array correctly without having to use the loop. How do I do it?
BTW, without the correction, formula is slightly inaccurate.
The most accurate AFL (that I can come up with ) for the same is
Code:
absoluteReturn = log(C/Ref(C,-1));
nseDailyVolatility= sqrt(0.06 * absoluteReturn * absoluteReturn + 0.94 * Ref(nseDailyVolatility,-1) * Ref(nseDailyVolatility,-1));
One minor correction transforms Ami into being happy,
Code:
absoluteReturn = log(C/Ref(C,-1));
[B]nseDailyVolatility= absoluteReturn;[/B]
nseDailyVolatility= sqrt(0.06 * absoluteReturn * absoluteReturn + 0.94 * Ref(nseDailyVolatility,-1) * Ref(nseDailyVolatility,-1));
I want to initialize the array correctly without having to use the loop. How do I do it?
BTW, without the correction, formula is slightly inaccurate.