query on adjRatios() function from TTR package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

query on adjRatios() function from TTR package

Pitabas Mohanty
Hi

Can anyone tell me how to find the adjusted closing price when there are
multiple split events on the same day? In India, a few companies have
announced stock split and stock dividend on the same day. When I use the
adjRatios() function, it only adjusts for the first event and not the
second event.

Any help will be greatly appreciated.

Regards

        [[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.
Reply | Threaded
Open this post in threaded view
|

Re: query on adjRatios() function from TTR package

Joshua Ulrich
On Mon, Jun 8, 2020 at 7:26 AM Pitabas Mohanty <[hidden email]> wrote:

>
> Hi
>
> Can anyone tell me how to find the adjusted closing price when there are
> multiple split events on the same day? In India, a few companies have
> announced stock split and stock dividend on the same day. When I use the
> adjRatios() function, it only adjusts for the first event and not the
> second event.
>
> Any help will be greatly appreciated.
>
Can you please provide an example, so I can investigate?

> Regards
>
>         [[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.



--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com

_______________________________________________
[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.
Reply | Threaded
Open this post in threaded view
|

Re: query on adjRatios() function from TTR package

Enrico Schumann-2
In reply to this post by Pitabas Mohanty
On Mon, 08 Jun 2020, Pitabas Mohanty writes:

> Hi
>
> Can anyone tell me how to find the adjusted closing price when there are
> multiple split events on the same day? In India, a few companies have
> announced stock split and stock dividend on the same day. When I use the
> adjRatios() function, it only adjusts for the first event and not the
> second event.
>
> Any help will be greatly appreciated.
>

Function 'split_adjust' in package 'PMwR' supports
several splits on a single timestamp.  Suppose a stock
split two times 2-for-1 on timestamp 2.  Then:

  split_adjust(x = c(100, 25, 25),  ## prices
               t = c(2, 2),         ## index when split occurs
               ratio = c(2, 2))     ## split ratio
  ## [1] 25 25 25

  split_adjust(x = c(100, 25, 49), t = c(2, 2),
               ratio = c(2,2), backward = FALSE)
  ## [1] 100 100 100
 
--
Enrico Schumann (maintainer of PMwR)
Lucerne, Switzerland
http://enricoschumann.net

_______________________________________________
[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.
Reply | Threaded
Open this post in threaded view
|

Re: query on adjRatios() function from TTR package

Pitabas Mohanty
Yes, it is working. I could finally compute the adjusted closing prices.

Thank you so much.

On Mon, Jun 8, 2020 at 6:17 PM Enrico Schumann <[hidden email]>
wrote:

> On Mon, 08 Jun 2020, Pitabas Mohanty writes:
>
> > Hi
> >
> > Can anyone tell me how to find the adjusted closing price when there are
> > multiple split events on the same day? In India, a few companies have
> > announced stock split and stock dividend on the same day. When I use the
> > adjRatios() function, it only adjusts for the first event and not the
> > second event.
> >
> > Any help will be greatly appreciated.
> >
>
> Function 'split_adjust' in package 'PMwR' supports
> several splits on a single timestamp.  Suppose a stock
> split two times 2-for-1 on timestamp 2.  Then:
>
>   split_adjust(x = c(100, 25, 25),  ## prices
>                t = c(2, 2),         ## index when split occurs
>                ratio = c(2, 2))     ## split ratio
>   ## [1] 25 25 25
>
>   split_adjust(x = c(100, 25, 49), t = c(2, 2),
>                ratio = c(2,2), backward = FALSE)
>   ## [1] 100 100 100
>
> --
> Enrico Schumann (maintainer of PMwR)
> Lucerne, Switzerland
> http://enricoschumann.net
>

        [[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.