GithubHelp home page GithubHelp logo

topshot99 / reinforcement-learning-stock-trading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from notadamking/stock-trading-environment

2.0 0.0 0.0 8.1 MB

A custom OpenAI gym environment for simulating stock trades on historical price data.

License: MIT License

Python 100.00%

reinforcement-learning-stock-trading's Introduction

Reinforcement Learning Stock Trading

This repository contains a reinforcement learning-based agent designed to navigate the stock market effectively. The agent learns to make trading decisions by training on historical stock price data.

Getting Started

Follow these steps to set up and use the RL stock trading agent:

  1. Fetch Historical Data

    • Execute python data-fetch.py to fetch historical data for your desired stock. Replace the stock symbol and date range with your preferences in the script.
    python data-fetch.py 

    This script retrieves historical stock price data, which will be used for training and testing the model.

    • Next, run TradingEnv.py to train the reinforcement learning model using the fetched data. Ensure that you have all the required dependencies installed (see requirements.txt).
    python TradingEnv.py
    
  2. Using a Pretrained Model Alternatively, this repository provides a custom trained model (trading_agent.zip) that you can load and use directly if you prefer not to train your own model.

  3. Testing the Model with Live Data Run TestTradingEnv.py to evaluate the accuracy of the trained model when making trading decisions on live data.

python TestTradingEnv.py
  1. Render the model This custom trained model can be rendered by running the renderscript
python renderscript.py

image

Additional Resources

  • Open AI gym reference docs: https://gymnasium.farama.org/
  • Feel free to explore and adapt the code to your specific needs in stock trading and reinforcement learning.

reinforcement-learning-stock-trading's People

Contributors

topshot99 avatar notadamking avatar milanagrawal avatar

Stargazers

 avatar rch 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.