[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Volatility vs. STD?



PureBytes Links

Trading Reference Links

will the following give 10 period volatility in 5 min bars

timeframeset(in5minute);
hv10 = StDev(log(C / Ref(C, -1), 10));
timeframerestore();

thanks


--- In amibroker@xxxxxxxxxxxxxxx, "cstrader" <cstrader232@xxx> wrote:
>
> Lovely... thank you
> 
> 
>   ----- Original Message ----- 
>   From: wavemechanic 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, July 13, 2007 1:22 PM
>   Subject: Re: [amibroker] Re: Volatility vs. STD?
> 
> 
>   historical volatility = StDev(log(C / Ref(C, -1), period) *
sqrt(251) * 100
> 
>   ----- Original Message ----- 
>   From: "cstrader" <cstrader232@xxx>
>   To: <amibroker@xxxxxxxxxxxxxxx>
>   Sent: Friday, July 13, 2007 8:05 AM
>   Subject: Re: [amibroker] Re: Volatility vs. STD?
> 
> 
>   > Formula attached...
>   > 
>   > ----- Original Message ----- 
>   > From: "cstrader" <cstrader232@xxx>
>   > To: <amibroker@xxxxxxxxxxxxxxx>
>   > Sent: Friday, July 13, 2007 7:47 AM
>   > Subject: Re: [amibroker] Re: Volatility vs. STD?
>   > 
>   > 
>   >> OK, digging deeper I found a can of worms
(http://www.sitmo.com/eqcat/4)
>   >>
>   >> Below is a simple formula, although there are others (for
instance some 
>   >> that
>   >> ignore overnight gaps)
>   >> Anyone might have already coded this in AFL?, or feel like
doing it? (my
>   >> patience is too thin today)
>   >>
>   >> However, I found that if I use the the STD divided by the
square-root of 
>   >> the
>   >> #bars for the year, then I get a figure that seems to mesh with
other
>   >> sources.  For instance, the 30 and 200 day volatilies of QQQQ
using these
>   >> formulas:
>   >>
>   >> VOl200a = StDev(C, 200) / sqrt(265);
>   >>
>   >> Vol30a = StDev(C, 30) / sqrt(265);
>   >>
>   >> turn out to be about .22 and .11 respectively.
>   >>
>   >> Maybe that is close enough?
>   >>
>   >> List of symbols
>   >>
>   >>
>   >>     Volatility
>   >>
>   >>
>   >>     The closing price on the ith day
>   >>
>   >>      n
>   >>     Number of historical days used in the volatility estimate
>   >>
>   >>
>   >>     Log return on the ith day
>   >>
>   >>      Z
>   >>     The number of closing prices in a year
>   >>
>   >>
>   >>
>   >>
>   >>
>   >>
>   >>
>   >>
>   >> Historical Close-to-Close Volatility
>   >>
>   >>
>   >>
>   >>
>   >>
>   >>
>   >>
>   >> Historical volatility calculation using close-to-close prices.
>   >>
>   >>
>   >>
>   >>
>   >> ----- Original Message ----- 
>   >> From: "vlanschot" <vlanschot@xxx>
>   >> To: <amibroker@xxxxxxxxxxxxxxx>
>   >> Sent: Friday, July 13, 2007 5:33 AM
>   >> Subject: [amibroker] Re: Volatility vs. STD?
>   >>
>   >>
>   >>> Several points:
>   >>>
>   >>> 1) Usually people use the returns to calculate volatility, not
Price,
>   >>> i.e. ROC (C,1) or LN(C/Ref(C,-1)).
>   >>> 2)Strictly speaking, one needs to make a distinction between full
>   >>> population or sample. As far as I know, afl's StDev assumes full
>   >>> population.
>   >>> 3) Volty is usually quoted indeed on an annualised basis.
Therefore
>   >>> multiply your calc by the square-root of the #bars for the
year, i.e.
>   >>> sqrt (12) if you've calculated in monthly mode, sqrt (256) or sqrt
>   >>> (365) in daily, etc.
>   >>>
>   >>> PS
>   >>>
>   >>> --- In amibroker@xxxxxxxxxxxxxxx, "cstrader" <cstrader232@> wrote:
>   >>>>
>   >>>> Sorry, but what's the difference?  Is the annualized
volatility of a
>   >>> stock
>   >>>> about the same as STDev(C, 200)?
>   >>>>
>   >>>> Thanks!
>   >>>>
>   >>>
>   >>>
>   >>>
>   >>>
>   >>> Please note that this group is for discussion between users only.
>   >>>
>   >>> To get support from AmiBroker please send an e-mail directly to
>   >>> SUPPORT {at} amibroker.com
>   >>>
>   >>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>   >>> http://www.amibroker.com/devlog/
>   >>>
>   >>> For other support material please check also:
>   >>> http://www.amibroker.com/support.html
>   >>>
>   >>> Yahoo! Groups Links
>   >>>
>   >>>
>   >>>
>   >>
>   >>
>   >> Please note that this group is for discussion between users only.
>   >>
>   >> To get support from AmiBroker please send an e-mail directly to
>   >> SUPPORT {at} amibroker.com
>   >>
>   >> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>   >> http://www.amibroker.com/devlog/
>   >>
>   >> For other support material please check also:
>   >> http://www.amibroker.com/support.html
>   >>
>   >> Yahoo! Groups Links
>   >>
>   >>
>   >>
>   >> 
>   > 
>   > 
>   > Please note that this group is for discussion between users only.
>   > 
>   > To get support from AmiBroker please send an e-mail directly to 
>   > SUPPORT {at} amibroker.com
>   > 
>   > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>   > http://www.amibroker.com/devlog/
>   > 
>   > For other support material please check also:
>   > http://www.amibroker.com/support.html
>   > 
>   > Yahoo! Groups Links
>   > 
>   > 
>   > 
>   > 
> 
> 
>
------------------------------------------------------------------------------
> 
> 
>   No virus found in this incoming message.
>   Checked by AVG Free Edition. 
>   Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date:
7/12/2007 4:08 PM
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/