TensorTrade is an open-source reinforcement learning framework for training, evaluating and deploying trading agents. It provides the simulated markets, data plumbing and agent scaffolding you need to teach RL algorithms to trade, without building an entire backtesting stack yourself. The project has about 7,200 stars on GitHub and was updated in 2026.
TensorTrade is built around composable components. Data feeds stream price history or live data into the environment; exchanges simulate order execution, slippage and commissions; action schemes define what an agent can do (buy, sell, hold, position sizing); and reward schemes shape what it learns to optimize, from simple profit to risk-adjusted returns. Environments follow the familiar Gym-style interface, so agents trained with libraries such as Stable Baselines3, Ray RLlib or TensorForce plug in naturally. Portfolios track balances, positions and performance over time, and the same environment definition can be reused for training, backtesting and paper trading, which keeps experiments honest and comparable. The framework is instrument-agnostic โ stocks, crypto and forex data all fit the same abstractions โ and its Apache-2.0 codebase has been a long-running community project with extensive documentation and examples.
TensorTrade is completely free and open source under the Apache-2.0 license. Market data and any live-trading infrastructure are your own responsibility.
TensorTrade is for researchers, quant hobbyists and ML engineers who want to experiment with reinforcement-learning trading agents in a realistic simulated environment before risking real capital.