Code Monkey home page Code Monkey logo

trading-bot's Introduction

Overview

Stock Trading Bot using Deep Reinforcement Learning (Deep Q-learning), Keras and TensorFlow. Reinforcement Learning is a type of machine learning that allows us to create intelligent agents that learn from the environment by interacting with it, it learns by trial and error. After each action, the agent receives the feedback in the form of reward or penalty. The feedback consists of the reward and next state of the environment. The reward is usually defined by a human. We can define reward as the profit from selling the stock bought at the original starting point.

Google Stock Trading bot

Trading GOOGL, 2018 with a profit of $517.44

Dataset

You can either use the Historical Financial data already present under data/ or download your own from Yahoo! Finance for training.

Getting Started

In order to train the model, you will need to install the required python packages:

pip install -r requirements.txt

Now you can open up a terminal and start training the agent:

python train.py --train-stock data/GOOGL.csv --val-stock data/GOOGL_2018.csv

Once you're done training, run the evaluation script and let the agent make stock decisions:

python evaluate.py --eval-data data/AAPL_2018.csv --window-size 10 --model-name model_GOOGL_10 --debug

Now you are all set up!

References

Built With

  • Python
  • TensorFlow
  • NumPy

Credits

The project is a modification/impovement over edwardhdlu/q-trader.

trading-bot's People

Contributors

pskrunner14 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.