pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
2.03k stars 300 forks source link

Uber and Lyft total returns not making sense in the .calc_stats() object #88

Closed alechter closed 4 years ago

alechter commented 4 years ago

Hello!

First off, I'm a huge fan of the FFN package and appreciate you open-sourcing it!

I recently was discussing Uber and Lyft stocks with a friend and wanted to implement your package to calculate total returns. I ran the following code:

import ffn as f
prices = f.get('UBER,LYFT')
ax = prices.calc_stats().display()

Running this code generates the following report: Screen Shot 2020-01-13 at 4 54 25 PM

Given Uber began selling shares publicly at $45 a share (and are now trading at $34.14) while Lyft IPO'd at $72 (and are now trading at $46.35), some of these results don't tie out to me. I would expect the code written above to show total returns of around -24% and -36% for Uber and Lyft, respectively.

Please keep me posted on thoughts and thanks again for contributing!

Cheers, Adrian

y26805 commented 4 years ago

As stated in the docs (http://pmorissette.github.io/ffn/quick.html#data-retrieval), by default Adjusted Close (and NOT the IPO pricing) is used as the security’s price.

Since UBER closed on 2019-05-10 (first day of trading) at $41.57, it makes sense to me that calculated returns work out to be -17.87%. ($34.14 / $41.57 -1 = -17.87%)

alechter commented 4 years ago

Thank you very much