This app is deprecated. I switched to different broker in 2017. I tried to maintain this repo, but it is becoming increasingly difficult mostly due to lack of interest. Many parts of this repo should be viable as long as the Robinhood API stays the same.
This app is relying on pandas-datareader for stock historical prices. Over the last couple years multiple APIs were obsoleted by their providers (Google Finance, Morningstar) and as I am no longer a RH client I have no time to keep up with those changes. If you encounter the "Bad Gateway" error or similar it is likely that the current market data source is no longer valid. You are welcome to fork and try different sources of quotes - I will try to fix it, when/if I have time.
Current API is TIINGO for stock and market index.
Python client to analyze the Robinhood portfolio. Based on unofficial robinhood-api and python libraries for financial analysis, such as:
Creates a Flask web server with lightweight pageReplaced with Jupyter notebook- Downloads orders and dividends from Robinhood account.
- Downloads market data from google API and market index from open source. Supports incremental download for additional dates to reduce a number of requests to open APIs.
- Calculates the total return of the portfolio, including dividend payouts and risk metric for the portfolio
- Calculates the risk metric for individual securities and correlations between securities
- Calculates Markowitz portfolios
Create virtual environment, install dependencies:
git clone https://github.com/omdv/robinhood-portfolio && cd robinhood-portfolio
virtualenv robinhood && source robinhood/bin/activate && pip3 install -r requirements.txt
Or using conda (my preference):
conda create -n robinhood python=3.7
conda activate robinhood && pip install -r requirements.txt
To run:
jupyter notebook
Open main.ipynb
, enter TIINGO api_key
, Robinhood credentials, set demo_run
variable to False
to run with your data, execute all cells.
docker run --name robinhood -d -p 8888:8888 omdv/robinhood-portfolio:notebook start.sh jupyter notebook --NotebookApp.token='' --notebook-dir='./work'
Once up and running connect to http://localhost:8888. Open main.ipynb
, follow instructions.
This tool uses the unofficial Robinhood API to access your account. This code and the corresponding tools are provided on "as is" basis and the user is responsible for the safety of his/her own account.