[R-SIG-Finance] How to compute percentage change of xts ?

Jeff Ryan jeff.a.ryan at gmail.com
Thu Jul 3 01:11:50 CEST 2008


In quantmod:

OpCl will get you the Open to Close

and ClCl will do the same for Close to Close

They are wrappers to the Delt function, which allow for both
arithmetic and log returns.

There is also periodReturn in quantmod to provide the ClCl
functionality as well.

HTH
Jeff

On Wed, Jul 2, 2008 at 1:56 PM,  <pierre8r-list at yahoo.fr> wrote:
> Helllo,
>
> Sorry, I repost my e-mail because I forgot the title.
>
> My script creates an xts object.
>
>
> First question:
> I would like to compute for each Open Close from this time-series, the percentage change.
> Is there a function that realizes this?
>
> Second question:
> I wish also to calculate the percentage change between two consecutive Close.
> Is there a function that realizes this?
>
> Thank you,
>
> Pierre8r
>
>
>
>      ____________________________________________________________
> ente http://mail.yahoo.fr
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list