Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 2.22 KB

File metadata and controls

83 lines (55 loc) · 2.22 KB

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.