FinRL

Gym-style market environments and deep-RL agents for trading research, MIT-licensed.

Best for students and researchers reproducing financial reinforcement-learning papers on daily US stock bars; not for anyone who needs a current package, a realistic fill model or live execution.

by AI4Finance Foundation

Last updated

From
Licence
MIT
Self-hosted
Yes
Platforms
Library

What it is

FinRL is the AI4Finance Foundation's library for training deep reinforcement-learning agents on market data. It is built in three layers. Market environments are gym-style simulators for single stocks, a multi-stock account, portfolio allocation and crypto. Agent wrappers sit over Stable-Baselines3, ElegantRL, Ray RLlib and, since September 2026, FastTD3. Applications are worked examples for stock trading, ensembles and portfolio allocation. The loop is train, test, trade. An agent sees prices, holdings and indicators, outputs a buy or sell quantity per ticker, and is rewarded by the change in account value.

The 2026 tutorial is the shape of the whole thing. It downloads a fixed 30-ticker Dow list from Yahoo and adds MACD, RSI, VIX and a turbulence index. It trains A2C, DDPG, PPO, TD3 and SAC for 20,000 timesteps each on 2014–2025, then backtests them on 1 January to 20 March 2026 against a mean-variance portfolio and the DJIA.

The repository now describes itself as the "original" framework for education and research. Its README sends new users to FinRL-X, a separate Apache-2.0 repository where strategies return portfolio weights instead of acting inside a gym environment. MIT per the LICENSE file, about 16,600 stars, not archived, first published in July 2020.

Pricing

The library is MIT, and the site's FAQ says that commercial use is allowed. finrl.ai also advertises a Pro tier at $19.90 a month or $199 a year and an Enterprise tier on request, but the Pro button opens an email rather than a checkout (see the FAQ). The real costs are compute and data: Alpaca, WRDS and FXMacroData each need an account of their own.

Data & coverage

The README's table lists fifteen data sources. The DataProcessor class, which the pipeline goes through, accepts only four: yahoofinance, alpaca, wrds and fxmacrodata. Anything else raises "Data source input is NOT supported yet". Processor files for CCXT, EODHD, JoinQuant, QuantConnect and Sinopac sit in the tree but are not wired in. Separate downloaders cover Tushare for China, Shioaji for Taiwan and Interactive Brokers through ib_insync. Everything is OHLCV bars plus the indicators FinRL computes. It ships no data of its own.

Integrations

Python only. Agents come from Stable-Baselines3, ElegantRL (installed from its git master) and RLlib, and evaluation uses pyfolio-reloaded. The paper-trading class talks to Alpaca through alpaca_trade_api, the older of Alpaca's two Python SDKs, which has had no release since January 2024. It polls on a fixed interval and submits market orders with day time-in-force.

Limitations

  • The environment is the backtest, and its fill model is simple. An order fills at the close in the agent's own state, the bar it just observed, plus a flat percentage cost (0.1% each way in the tutorial). There is no next-bar delay, no spread and no slippage. The README's comparison table calls this "custom hand-rolled evaluation loops".
  • The tutorial universe is fixed. The list in config_tickers.py includes NVDA, AMZN and SHW and is applied unchanged to every day from 6 January 2014, so the backtest holds today's index members on dates when some were not in the index.
  • Packaging is broken in two directions: the PyPI wheel declares no dependencies, and the repository's own pins hold yfinance and ccxt a major version behind.
  • The hosted docs still build as version 0.3.1, and their install page tells you to install Anaconda first.
  • "FinRL" is a trademark of FinRL LLC, licensed to the foundation. The MIT licence covers the code, not the name.

Alternatives

Qlib is the closest research pipeline. It does supervised factor models rather than RL, ships a model zoo and keeps its own data store. VectorBT and Backtesting.py are the tools to reach for once a policy has to survive a fill model you trust. FinGPT and FinRobot are the same foundation's LLM projects and solve a different problem. FinRL-X is the foundation's successor: it backtests on bt, rebalances through Alpaca and borrows only FinRL's DRL portfolio environment.

Specs

Interfaces
Python, Python
Export
CSV
Asset classes
Stocks, ETF, Crypto, Forex
Markets
US, Asia
Platforms
Library
AI features
Research
Capabilities
Backtesting, Automation, Paper trading
Pricing verified
Capabilities verified
Coverage verified

Also from AI4Finance Foundation

Also worth comparing

  • Kronos — Open-weights transformer pre-trained on OHLCV bars. The training corpus is not released.
  • Qlib — Microsoft's ML factor-research pipeline. The data its CLI downloads stops in late 2020.
  • Backtesting.py — A single-instrument Python backtester — one OHLC series, one strategy, no live trading.
  • Backtrader — An event-driven Python backtester with 122 indicators, frozen since April 2023.
  • bt — Python backtesting for allocation and rebalancing rules, not entries and exits.
  • fastquant — A one-call wrapper over Backtrader, dormant since 2023 and broken on PyPI.

FAQ

Is FinRL still maintained?

The repository is, the package less so. On 7 October 2026 the last commit to master was 28 September 2026, a batch of merged bug fixes, and the repository was not archived. The last tagged release, v0.3.8 on 20 March 2026, added the 2026 tutorial scripts. 284 issues and 25 pull requests were open. The README now sends new users to FinRL-X, a separate repository.

Does pip install finrl give me a working install?

No. PyPI holds 0.3.7 from 12 April 2024, and that wheel declares no dependencies at all, so it installs without Stable-Baselines3, PyTorch, yfinance or anything else the code imports. Installing from the repository builds 0.3.8 through pyproject.toml, which pins yfinance below 0.3 (PyPI is at 1.7.0), ccxt below 4, alpaca-py to 0.37 and ElegantRL to its git master.

Can FinRL trade a real account?

It ships a paper-trading loop for Alpaca whose default endpoint is Alpaca's paper API. The README's own comparison table rates FinRL's live trading as "Basic Alpaca support" with risk management limited to "Gym environment constraints only", and points anyone deploying capital to FinRL-X instead.

What does the paid Pro plan on finrl.ai get you?

We could not find out. The pricing page lists Pro at $19.90 a month or $199 a year, with extended datasets, risk modules and a faster backtest engine, but its button opens a pre-filled email to the project's contact address. There is no checkout, and the site's own FAQ says the MIT licence already permits commercial use.

Report an error on this page

Quote the line and say what it should be.

The vendor’s page, filing or documentation that says otherwise.

Only if you want to hear back. Never published.

Read by a person. It fixes a fact and moves nothing else.

Is this your product? Claim this listing.