Live quantitative trading algorithms for Robinhood in Python 3.
This project uses my fork of Jamonek's Robinhood Python wrapper to make servers calls warranted by the algorithms in this project given various financial data from the API. Calls include placing buys and sells, making calls and puts, and retrieving instrument data. This repository is a work in progress, and since I obviously don't store my credentials in this repo, anyone can fork it, give it a whirl, and perhaps contribute their own financial knowledge.
- Clone this repository.
- Open a terminal window and
cd
to the project. - Upgrade your setup tools with
pip3 install --upgrade setuptools --user python
. - Install all required dependencies with
pip3 install -r requirements.txt
. - Create a file called
.env
and fill it with your credentials:
EMAIL=yourEmail@probably.com
PASSWORD=yourPassword123
- Run the driver with
python3 driver/run.py
. It will usepython-dotenv
to load yourEMAIL
andPASSWORD
, so you don't have to worry about hardcoding these credentials.
- Copy and paste
src/algorithms/__skeleton.py
into the same folder. Rename it to something of your choosing, and be sure to change the class name. - Add
from algorithms.your_algorithm import *
tosrc/algorithms/__init__.py
. - Follow the instructions in the skeleton file to write your algorithm.
- After writing your algorithm, call it as follows at the bottom of
driver/run.py
:
-
If backtesting:
YourAlgorithm(query, my_port, test=True, cash=1000)
($1000 is the starting cash amount) -
If live trading:
YourAlgorithm(query, my_port)
- Run your code with
python3 driver/run.py
.
If you'd like to improve and/or expand the content of this library, feel free to submit pull requests. If you experience any issues with this code, please let me know promptly.
- Anthony Krivonos - Developer - Portfolio
This project is licensed under the MIT License - see the LICENSE.md file for details
- Vicki Shao for all the support and flames! 🔥