On 3/10/2016 10:49 AM, Alan alan@thenorthams.us [amibroker] wrote:
AMIBroker does not have an Historical Volatility Function. However, the code below seems to be the simplest. -Alan
//Calculates Historical Volatility
Period = 63;
DaysinYear = 252;
hv = StDev(ROC(C,1),Period)*sqrt(DaysinYear);
Plot(hv,"Historical Volatility",colorBlack);
On 3/10/2016 10:10 AM, 'U.Mutlu' um4711@mutluit.com [amibroker] wrote:
Alan alan@thenorthams.us [amibroker] wrote on 03/10/2016 04:43 PM:
> What day and time are you using to get SPY = 19.69%. Also what is number of
> look back periods and what number are you using for number of yearly bars. I
> need this info so I can try to duplicate your calculations. -Alan
I used period=63 days, ie. using EOD data that goes back several years and
upto yesterday.
> On 3/10/2016 8:51 AM, 'U.Mutlu' um4711@mutluit.com [amibroker] wrote:
>>
>> oliver.ward@rocketmail.com [amibroker] wrote on 03/10/2016 02:36 PM:
>> > Would this work instead?
>> >
>> > x = StDev(ROC(C,2),period)/sqrt(1/252)*100;
>>
>> Hmm, no, that gives unfortunately not the historical volatility.
>> For example for SPY: 19.69% vs. the result of the above which gives 2686.62%.
Posted by: Alan <alan@thenorthams.us>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (9) |
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/
EmoticonEmoticon