anthonyk1225 / robinhood-to-xlsx Goto Github PK
View Code? Open in Web Editor NEWPython package that grabs your robinhood data and exports it to excel
License: MIT License
Python package that grabs your robinhood data and exports it to excel
License: MIT License
Hello! Hope all is well!
Right now, expired call options still shows up as "unrealized premium" in the P/L table.
Instead, expired call options should show up in the P/L column.
I haven't experimented with puts, so don't have data points for those.
Cheers!
Hi,
Thank you so much for this project. Exporting to JSON presents no problems, however, when doing it to Excel I receive a ZeroDivsionError
. It only happens for Orders
. This was previously referenced in #12, however it's resurfaced it looks like.
Traceback (most recent call last):
File "app.py", line 48, in <module>
run()
File "app.py", line 41, in run
json_to_xlsx.run(answer)
File "/Users/jacobwall/GitHub/robinhood-to-xlsx/controllers/json_to_xlsx.py", line 81, in run
formula_pipelines[entity](formula_worksheet, workbook, sorted_data)
File "/Users/jacobwall/GitHub/robinhood-to-xlsx/formulas/orders.py", line 82, in handle_formulas
write_aggregates(worksheet, workbook, data)
File "/Users/jacobwall/GitHub/robinhood-to-xlsx/formulas/orders.py", line 33, in write_aggregates
aggregates = aggregate_data(data)
File "/Users/jacobwall/GitHub/robinhood-to-xlsx/formulas/orders.py", line 23, in aggregate_data
equity_average = aggregates[symbol]['equity'] / aggregates[symbol]['quantity']
ZeroDivisionError: division by zero
after running
$ virtualenv venv
my console shows
(base) instead of (venv), is this an issue?
When I tried to run this line
(venv) $ touch credentials.py
the console responds with
'touch' is not recognized as an internal or external command,
operable program or batch file.
Thanks in advance..
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.
line 70, in generate_auth_tokens
return response["access_token"], response["refresh_token"]
KeyError: 'access_token'
Originally posted by @Georgedumpers in #11 (comment)
Hey @anthonyk1225, got a new issue here. When I run the app by calling app.py
, selecting json
no longer prompt me to enter 2FA, and my history was not updated. Any ideas? Thanks!
Currently, events are being exported to their own excel file. These belong to things such as option orders and orders. It would be beneficial to look at what they belong to and see how to aggregate it in.
Authentication and JSON files download just fine. But, I receive this error when running for XLSX.
[?] What would you like to run: xlsx(Excel file)
json(Robinhood history)
> xlsx(Excel file)
[?] What would you like to generate?: orders
dividends
events
options
> orders
cancel
SENDING REQUEST FOR THE INSTRUMENT URL
There was an error fetching the instrument 'OperationalError' object has no attribute 'message'
SENDING REQUEST FOR THE INSTRUMENT URL
There was an error fetching the instrument 'OperationalError' object has no attribute 'message'
Traceback (most recent call last):
File "app.py", line 49, in <module>
run()
File "app.py", line 43, in run
json_to_xlsx.run(report_answer)
File "/Users/emilyschmader/robinhood-to-xlsx/controllers/json_to_xlsx.py", line 33, in run
sorted_data = sorted(filtered_data, key=lambda k: k[entity_sort_on[entity]])
File "/Users/emilyschmader/robinhood-to-xlsx/controllers/json_to_xlsx.py", line 33, in <lambda>
sorted_data = sorted(filtered_data, key=lambda k: k[entity_sort_on[entity]])
KeyError: 'symbol'
Right now there is only information on the option order as a whole. There are situations where there are multiple legs. Either need to somehow aggregate the information, or display it on subsequent lines within excel file.
In the P/L calculation, number of shares held does not correctly reflect the number of shares I hold in my RH account.
If holding options or shares of a company when a stock split or reverse stock split happens, the profit/loss on sheet 2 for options.xlsx
or orders.xlsx
won't be accurate for those companies.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.