Skip to content

An AI‑driven stock trading bot, incorporating neural networks with advanced Reinforcement Learning (RL) algorithms such as DQN, PPO and others.

License

Notifications You must be signed in to change notification settings

RohanSreelesh/Reinforcement-learning-based-trading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reinforcement Learning Based Trading Bot

Poetry python code style: black Discord

This project explores various Reinforcement Learning techniques on stock trading with the help of Gymnasium framework.

Getting Started

Prerequisites

  • Python 3.11
  • Poetry (for dependency management)

Installation

  1. Clone the Repository

    git clone https://github.com/RohanSreelesh/4900_RL.git
    cd 4900_RL
  2. Install Poetry

    If you haven't installed Poetry yet, you can do so by following the instructions here.

  3. Install Dependencies via Poetry

    poetry install

Algorithms

Random Action

poetry run basic

Q-Learning with Linear Function Approximation

poetry run q_with_function_approximation

Dynamic Q-Learning with Linear Function Approximation

poetry run dyna_q

SARSA

poetry run sarsa

Proximal Policy Optimization

poetry run ppo

Deep Q Networks

Due to configuration issues and RAM + GPU needed to train neural networks, this algorithm only runs on Google Collab.

  • Import the deep_q.ipynb into collab and run each code block.
  • The Training() Function generates a model which can then be imported or stored for future use.
  • The demo() function imports the model and runs a single episode on the NASDAQ_TEST dataset to verify performance

Features

  • Reinforcement learning techniques.
  • Integration with Gymnasium for creating custom trading scenarios.
  • Visualization of trading strategies and account balance using matplotlib.
  • Ability to simulate and visualize buy, sell, and hold actions over time.

License

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

About

An AI‑driven stock trading bot, incorporating neural networks with advanced Reinforcement Learning (RL) algorithms such as DQN, PPO and others.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published