Interanual Return

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Interanual Return

Pedro páramo
Hi all,

I want to calculate interanual (not year to date) variation of a stock, I
am able to obtain year to date with annualReturn, but no way to obtain the
interanual increase. It says me no numerical output.

Can anyone guide me to obtain it.

library(PerformanceAnalytics)
library(dplyr)
library(tibble)
library(lubridate)
library(PerformanceAnalytics)
library(quantmod)
library(ggplot2)
library(png)
library(RCurl)

fecha<-Sys.Date()-365 #with this I obtain one year back beginning
precio<-getSymbols("ACX.MC <http://acx.mc/>",from='fecha')
ret2<- na.omit(CalculateReturns(Cl(ACX.MC <http://acx.mc/>)))
g<-annualReturn(ACX.MC <http://acx.mc/>) #This is year to date
d<-CalculateReturns(Cl(ACX.MCC))
aaa<-getQuote('ACX.MC <http://acx.mc/>',from='fecha')
Lastprice<-aaa[1,2]

lo<-c(diff(log(aaa),250))  #With this I try  to obtain interanual year
variation but error


Hope you can help me

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.