[R-SIG-Finance] How can I calculate annualized log returns when the year is different from a calendar year
Brian G. Peterson
br|@n @end|ng |rom br@verock@com
Mon Nov 9 14:29:09 CET 2020
I don't use tidyquant, but you can easily use endpoints() in xts to get
the end of March timestamps and calculate your period return that way.
Brian
On Mon, 2020-11-09 at 13:45 +0530, Maulik Bhatt wrote:
> Dear all,
>
> I want to calculate annualized log return for a security. But the
> issue
> is that the company follows financial year from April to March. So,
> all
> its other ratios are calculated from April to March year. The data is
> taken using the package tidyquant.
>
> library(tidyquant)
>
> df<- tq_get("SBIN.NS")
>
> From the package vignette of tidyquant, the periodReturn can be
> calculated for yearly, but in that case the year is calendar year.
> But I
> want to get the return for financial year. In case of this company,
> the
> financial year is from April to March. So, what modifications do I
> need
> to make in order to calculate annual log return from April to March?
>
> Thanks in advance,
>
> Maulik.
>
> _______________________________________________
> R-SIG-Finance using r-project.org 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.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list