◉AgentFinanceFree
FinRL — Deep Reinforcement Learning for Trading
AI4Finance Foundation's framework for training RL agents to trade stocks, crypto, and forex with backtesting, paper trading, and live execution support.
FinRL — Deep Reinforcement Learning for Trading
FinRL is a comprehensive deep reinforcement learning library for automated stock trading. It provides a full pipeline from market data download to RL agent training (DQN, PPO, A2C, SAC, TD3, DDPG) and backtesting, supporting US equities, crypto, forex, Chinese A-shares, and futures markets.
Key Features
- Gym-compatible trading environments with realistic transaction costs and slippage
- Built-in RL agents via Stable-Baselines3 and ElegantRL backends
- Data pipelines: Yahoo Finance, Alpaca, Binance, AkShare, WRDS
- Ensemble strategies combining multiple RL agents
- Paper trading mode via Alpaca and CCXT
- Cryptocurrency and multi-asset portfolio support
Quick Start
from finrl.meta.preprocessor.yahoodownloader import YahooDownloader
from finrl.meta.env_stock_trading.env_stocktrading import StockTradingEnv
from finrl.agents.stablebaselines3.models import DRLAgent
df = YahooDownloader(start_date="2020-01-01", end_date="2023-12-31",
ticker_list=["AAPL","MSFT","GOOG"]).fetch_data()
env = StockTradingEnv(df=df, ...)
agent = DRLAgent(env=env)
model = agent.get_model("ppo")
model.learn(total_timesteps=100_000)
npx ai-supply add finrl-deep-rl-trading
Curated mirror of the open-source FinRL (MIT). Get it from the source.