TorchTrade/torchtrade
Modular reinforcement learning framework for algorithmic trading
What it solves
TorchTrade provides a unified machine learning framework for algorithmic trading, bridging the gap between research and production. It simplifies the deployment of reinforcement learning (RL) and Large Language Model (LLM) strategies by providing modular environments for both offline backtesting and live trading across multiple major exchanges.
How it works
Built on TorchRL, the framework uses a modular architecture where trading actors (the decision-makers) are separated from the environments (the market simulators or live APIs). It supports a wide range of RL methodologies (online, offline, model-based, and contrastive learning) and integrates LLMs as trading agents that can use external tools for reasoning. The system handles multi-timeframe observations, feature engineering with technical indicators, and portfolio management across multiple assets.
Who it’s for
It is designed for quantitative traders, AI researchers, and developers looking to implement, train, and deploy RL or LLM-based trading strategies in cryptocurrency and prediction markets.
Highlights
- Multi-Strategy Support: Implements PPO, DQN, IQL, GRPO, and DSAC, alongside rule-based strategies and LLM actors.
- Live Exchange Integration: Direct connectivity to Alpaca, Binance, Bitget, Bybit, and OKX.
- LLM Capabilities: Supports local and frontier LLMs with tool-use capabilities and fine-tuning via GRPO or SAO.
- Flexible Environments: Offers sequential, one-step, and portfolio-based environments for both spot and futures trading.
- Research-to-Production: Uses the same codebase for backtesting and live deployment to ensure consistency.
Related
- Project
- Project
- Project
- Project
- Project