anthonyk1225 / robinhood-to-xlsx

Python package that grabs your robinhood data and exports it to excel
MIT License
14 stars 3 forks source link

Incorrect amount of equity owned & P/L #14

Closed kfchou closed 4 years ago

kfchou commented 4 years ago

Here comes another one.

Looking at the equity owned column, I find that some numbers are correct, and some are not. Equity owned can be incorrect even if number of shares held is correct.

Manually checking the amount of equity owned by doing some math using the info from sheet 1, I found that the numbers I manually calculate differs from the numbers shown in sheet 2. For example, here are some transactions for one company's stock I've traded. The first four transactions results in 0 shares owned. Then I made a purchase for 5 shares in the last row, this is shown correctly in sheet 1:

side quantity ---- price ---- symbol # shares bought/sold total paid
buy 5 ---- $62.50 ---- xxxx 5 312.5
sell 4 ---- $65.02 ---- xxxx -4 -260.06
buy 4 ---- $64.86 ---- xxxx 4 259.44
sell 5 ---- $64.89 ---- xxxx -5 -324.425
buy 5 ---- $136.16 ---- xxxx 5 680.8

By this information, I should have had a $12 loss, and own $680.8 of equity.

sheet 2 shows the following:

COMPANY P/L SHARES HELD EQUITY OWNED
xxxx -$220.89 5 $447.41

which shows the correct number of shares held, but incorrect P/L and equity owned.

anthonyk1225 commented 4 years ago

@kfchou my dude. Fixed it once again. Came to a realization that I was using the wrong date to sort on and the algo was fine as is before the change yesterday. I've updated it, so if you want to try again, have a go and let me know.

kfchou commented 4 years ago

Looking good now! The only issue left is the missing orders on Robinhood's end.