Giter VIP home page Giter VIP logo

algorobinhood's Introduction

AlgoRobinhood

Algorithmic Trading System with Machine Learning

  • An Algorithmic Trading System connecting to Robinhood to execute various algo trading strategies
  • Stocks Recommendation System based on Machine Learning Models

Getting Started

These instructions will enable you to run an algo trading system on your local machine

Prerequisites

You need a robinhood account with a two factor code setup using your phone number. At the point of executing AlgoRobinhood, you will put the account id, password and the two-factor codes in terminal to login

$ python AutoTrade.py

Enter your account id: [email protected]
Do you want to run recommendation code (y/n): y
What recommendation model you want to use (LSTM/RF): LSTM
Enter your password: *****
Please Enter SMS Code: ******
2019-09-30 23:22:16,785 __main__ Successfully logged in account
2019-09-30 23:22:16,785 __main__ Running stocks recommendation for today...
...
2019-09-30 23:28:54,145 __main__ The code is outside execution period.
2019-09-30 23:28:54,202 __main__ Successfully logged out account.

Installing

Make sure you have below python packages installed:

  • tensorflow
  • xgboost

Git clone the AlgoRobinhood codebase and you should be ready to go:

git clone https://github.com/ChrisZheng1985/AlgoRobinhood.git

Running the AlgoRobinhood

Simply git clone this codebase and execute the below command. After successfully login in, a log file will be generated under /log, with detailed information like recommendations made from a tensorflow model predction, as well as buy/sell operations being executed if any

python AutoTrade.py

Example of a log file

2019-10-02 22:35:17,385 __main__ Auto trading start at 2019-10-02 22:35:17
2019-10-02 22:35:17,385 __main__ The code is outside execution period.
2019-10-02 22:35:31,913 __main__ Successfully logged in account
2019-10-02 22:35:31,914 __main__ Running stocks recommendation for today...
2019-10-02 22:35:38,262 recommendation_system.recommendation Using Random Forest - RF to train and validate each stock price...
2019-10-02 22:35:39,102 recommendation_system.recommendation Symbol SNAP model accuracy is 79.73%, with prob of 7.5% to go up by 5.0% over the next 5 days 
2019-10-02 22:35:39,412 recommendation_system.recommendation Symbol AAPL model accuracy is 89.19%, with prob of 5.99% to go up by 5.0% over the next 5 days 
...
2019-10-02 22:35:51,735 recommendation_system.recommendation Symbol UBER model accuracy is 93.24%, with prob of 16.7% to go up by 5.0% over the next 5 days 
2019-10-02 22:35:51,977 recommendation_system.recommendation Symbol COF model accuracy is 91.89%, with prob of 3.0% to go up by 5.0% over the next 5 days 

2019-10-02 22:35:51,977 recommendation_system.recommendation Today's top 5 recommended stocks are: 
2019-10-02 22:35:51,977 recommendation_system.recommendation Symbol FB: Rating 24.13% - Model Accuracy 94.59%
2019-10-02 22:35:51,977 recommendation_system.recommendation Symbol UBER: Rating 16.7% - Model Accuracy 93.24%
2019-10-02 22:35:51,977 recommendation_system.recommendation Symbol NFLX: Rating 15.93% - Model Accuracy 94.59%
2019-10-02 22:35:51,978 recommendation_system.recommendation Symbol SNE: Rating 13.67% - Model Accuracy 86.49%
2019-10-02 22:35:51,978 recommendation_system.recommendation Symbol TWTR: Rating 12.24% - Model Accuracy 82.43%
2019-10-02 22:35:51,978 __main__ The code is outside execution period.
2019-10-02 22:35:52,025 __main__ Successfully logged out account.

Web-based Deployment

Example will be added about how to deploy this on a user-friendly web based system

Example to be added

Built With

  • Python 3.6 - Codebase development and execution
  • Django - The web framework development

Versioning

  • Version 1.0

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Working in progress:

  • Build Github page with more information in README.md - done on 20190929;
  • Optimize the data pipeline for modeling, and do codebase refactoring; - done on 20190930
  • add modeling class, which can be extented to RF and XGBoost; - done on 20190930
  • Extend machine leaning models by adding Random Forest to do forecast; - done on 20191001
  • Extend machine leaning models by adding XGboost to do forecast; - in progress
  • Create Python package;
  • Build Web-based UI;
  • Build NLP on financial news, take it as additional features in ML models to enhance model performance;

algorobinhood's People

Contributors

chriszheng1985 avatar rjlackner avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.