Trading-Gym  by thedimlebowski

Open-source project for reinforcement learning algorithm development in trading

created 8 years ago
564 stars

Top 57.9% on sourcepulse

GitHubView on GitHub
Project Summary

Trading Gym is an open-source project designed for developing reinforcement learning (RL) algorithms specifically for trading applications. It provides a flexible trading environment, SpreadTrading, allowing users to train RL agents on various price data feeds and spread coefficients. The project aims to be compatible with the OpenAI Gym API, offering a specialized environment for financial RL research.

How It Works

The core of Trading Gym is the SpreadTrading environment, which simulates trading a spread across multiple products. It accepts time-series price data (bid and ask) for n products and a list of spread coefficients. Agents can perform actions like buying, selling, or holding the spread, with actions applied to the entire spread rather than individual legs. The environment's state includes current prices, entry price, and the agent's position. Users can create custom data generators by inheriting from tgym/core.py's DataGenerator base class, overriding the _generator method to yield price data.

Quick Start & Requirements

  • Install via pip: pip install tgym
  • Recommended: Use virtual environments.
  • For dqn_agent.py example: pip install keras (with Theano or TensorFlow backend configured).
  • Official examples: tgym/examples/

Highlighted Details

  • Implements a SpreadTrading environment for RL-based spread trading.
  • API inspired by OpenAI Gym, aiming for full compatibility.
  • Supports custom data generators for flexible price feed integration.

Maintenance & Community

  • Project appears to be a solo effort by thedimlebowski.
  • No explicit community channels (Discord/Slack) or roadmap are mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

The project's license is not specified, which may impact commercial use or integration into closed-source projects. The README also lacks details on testing, benchmarks, or advanced features beyond the basic spread trading simulation.

Health Check
Last commit

4 years ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.