Open-source project for reinforcement learning algorithm development in trading
Top 57.9% on sourcepulse
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
pip install tgym
dqn_agent.py
example: pip install keras
(with Theano or TensorFlow backend configured).Highlighted Details
SpreadTrading
environment for RL-based spread trading.Maintenance & Community
Licensing & Compatibility
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.
4 years ago
1 week