TradingGym  by Yvictor

Trading environment for reinforcement learning agent training and backtesting

Created 8 years ago
1,740 stars

Top 24.6% on SourcePulse

GitHubView on GitHub
Project Summary

This toolkit provides a flexible environment for training and backtesting reinforcement learning agents for trading. It is designed for researchers and developers working with financial time-series data, offering a framework inspired by OpenAI Gym for creating custom trading strategies.

How It Works

TradingGym simulates trading environments using either tick or OHLC data, supporting custom feature engineering. It allows users to define observation window sizes (obs_data_len) and step increments (step_len), managing trading parameters like fees and maximum position size. The environment processes input dataframes and yields states, rewards, and transaction details, facilitating agent evaluation.

Quick Start & Requirements

  • Install via git clone https://github.com/Yvictor/TradingGym.git and python setup.py install.
  • Requires Python and Pandas. Data loading uses HDF5 format.
  • Example usage involves importing trading_env and creating an environment instance with specified parameters.

Highlighted Details

  • Supports both tick and OHLC data formats.
  • Includes training_v1 and backtest_v1 environment types.
  • Allows customization of fees, maximum position size, and feature sets.
  • Provides detailed transaction logs and reward tracking.

Maintenance & Community

The repository is actively maintained by Yvictor. Further community engagement details are not specified in the README.

Licensing & Compatibility

The repository does not explicitly state a license. Users should verify compatibility for commercial use.

Limitations & Caveats

The project is marked as "WIP" (Work In Progress), with several planned features like real-time trading and advanced RL algorithms (DQN, Policy Gradient, A3C) still under development. The README indicates potential for breaking changes as development progresses.

Health Check
Last Commit

1 year ago

Responsiveness

1+ week

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

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Will Brown Will Brown(Research Lead at Prime Intellect).

agent-lightning by microsoft

6.0%
2k
Train any AI agent with rollouts and feedback
Created 3 months ago
Updated 2 days ago
Feedback? Help us improve.