How to compute percentage change of xts ?
One note on the previous reply -- the OpCl functions expect the column names to contain 'Open' and 'Close' somewhere in the name. There are also many other function to do similar calculations, see ?Op Jeff
On Wed, Jul 2, 2008 at 6:11 PM, Jeff Ryan <jeff.a.ryan at gmail.com> wrote:
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
Jeffrey Ryan jeffrey.ryan at insightalgo.com ia: insight algorithmics www.insightalgo.com