[amibroker] statistical volatility function

 

Hi,
does there already exist a statistical volatility function in AB
for calculating the historical volatility?

The word "volatility" is multiple times present in the help-system,
but I think it means other uses.
I simply mean the stddev of natural logithms of the returns over a period,
annualized; ie. that what is the standard in the industry.

For this I'm currently using the following AFL-function of mine,
but was wondering if there is already an equivalent built-in func
for this that I maybe have overlooked when searching:

function my_volatility(Period, DaysInYear)
{ // DaysInYear should be 252 for stocks
local x;
x = 0;
for (i = 1; i < BarCount; ++i)
x[i] = ln(Close[i] / Close[i - 1]);
return StDev(x, Period) / sqrt(1 / DaysInYear) * 100.0;
}

If it doesn't exist yet, then I would suggest to add it into
the built-in core functions of AB.

--
Thx

__._,_.___

Posted by: "U.Mutlu" <um4711@mutluit.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv