โš ๏ธ Heads up: this tool's official website appears to be unreachable right now. It may be offline, rebranded, or temporarily down.
TradingGym

TradingGym

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

TradingGym is an open-source Python environment on GitHub for training reinforcement learning trading agents and backtesting trading strategies. With roughly 1,900 stars, it gives quant developers a Gym-style playground where algorithms can practice buying and selling against historical market data before risking real money.

Overview

The library wraps market data in an environment interface familiar to anyone who has used OpenAI Gym-style APIs: an agent observes market states, chooses actions such as buy, sell or hold, and receives rewards based on portfolio performance. The same environment doubles as a backtesting engine, so simple rule-based strategies can be evaluated through exactly the same loop as learned agents. TradingGym handles the bookkeeping of positions, cash and executed trades, and can render trading activity for inspection. It accepts your own price data, which makes it usable across stocks, crypto and other time-series markets. The codebase is compact and readable, making it a popular teaching and prototyping tool for algorithmic trading with machine learning.

Key Features

  • Gym-style environment for reinforcement learning trading agents
  • Backtesting for rule-based strategies through the same interface
  • Handles positions, cash balances and trade execution bookkeeping
  • Works with custom historical price data from any market
  • Rendering of trades and portfolio evolution for analysis
  • Lightweight, dependency-light Python implementation
  • MIT licensed and easy to embed in research code

Because the environment follows familiar reinforcement learning conventions, agents built with common RL libraries can be plugged in with little glue code, and experiments can swing between pure backtesting and full agent training without changing the surrounding pipeline.

๐Ÿ’ณ Pricing

TradingGym is free and open source under the MIT license. It can be installed from GitHub and used in commercial or research projects without fees; you only supply your own market data and compute for training agents.

Who Is It For

TradingGym is for quant developers, ML researchers and students who want to prototype reinforcement learning for trading, compare agent policies against simple baselines, and learn how trading environments are constructed before moving to production-grade backtesting stacks.

๐Ÿš€ Visit TradingGym Official Site

๐Ÿšฉ Report an issue