AI4Finance-Foundation

FinRL: Research Financial Trading with Reinforcement Learning

FinRL is an educational and research framework for building reinforcement-learning trading agents. It provides a train-test-trade workflow and market data processing, but its maintainers direct production-oriented development to FinRL-Trading.

Stars
16.5k
Forks
3.5k
Stars, last 16 days
+224

Our take

Health score

56/100

How it is scored
Activity
50
Community
89
Issues
38
Pull requests
46

+224 stars in the last 16 days

  • More contributors than 77% of the projects we track
  • Slower to close issues than 92% of the projects we track

Overview

FinRL is a Python-based framework for experimenting with reinforcement learning in quantitative finance. It connects market environments, DRL agents, and financial applications in a train-test-trade workflow, helping learners and researchers prototype trading policies against historical market data.

The repository preserves the original FinRL framework for education, benchmarking, and research prototyping. The maintainers recommend FinRL-Trading for modern production-oriented systems and live trading infrastructure.

Key Features

  • Market environments for stock, cryptocurrency, and portfolio-allocation tasks.
  • Support for DRL agents including A2C, DDPG, PPO, TD3, and SAC through the documented Stable Baselines 3 workflow.
  • A train-test-trade structure for developing and evaluating strategies.
  • Data processors for multiple providers, including Yahoo Finance, Alpaca, Binance, and WRDS.
  • Preprocessing workflows that combine market prices with technical indicators and other features.
  • Examples and tutorials for trading research, including an end-to-end stock-trading workflow.

Use Cases

  • Finance students can learn how an agent interacts with a market environment and trains a sequential decision policy.
  • Researchers can prototype and compare DRL approaches on financial tasks before developing a fuller experimental setup.
  • Quantitative developers can test data-processing and backtesting workflows using supported financial data sources.
  • Educators can use the examples to demonstrate reinforcement learning concepts in stock or cryptocurrency trading.

Getting Started

git clone https://github.com/AI4Finance-Foundation/FinRL.git
cd FinRL
pip install -e .

See the README for environment setup, example scripts, and installation details.

Alternatives

  • FinRL-Trading: FinRL-Trading focuses on advanced stock selection and deployment, while FinRL centers on an educational train-test-trade workflow for RL agents.
  • Lean: Lean is a general event-driven backtesting and live-trading engine, rather than a framework focused on reinforcement-learning research and education.
ProjectLanguageLicenseStarsStatus
FinRLJupyter NotebookMIT16.5kNot checked yet
FinRL-TradingPythonApache-2.03.8kActive
LeanC#Apache-2.021.9kActive

Considerations

  • This repository is positioned for education, research, and prototyping, not as the maintainers' recommended production trading stack.
  • Financial data access and request limits vary by provider. Some sources require an account or credentials.
  • Trading results from historical data do not establish future performance. The project explicitly disclaims financial advice, and users are responsible for decisions made with the software.
  • The README directs users building production-oriented or live trading systems to FinRL-Trading.

Found this useful?

Share it with someone who would like FinRL.

Comparisons