AI4Finance-Foundation

FinRL-Trading: Build and Deploy Quantitative Trading Strategies

FinRL-Trading is a modular Python system for developing, backtesting, and executing quantitative trading strategies. Its shared portfolio-weight interface connects strategy components to backtests and Alpaca trading, making it useful for researchers and practitioners evaluating end-to-end workflows.

Stars
3.8k
Forks
1.1k
Stars, last 16 days
+63

Our take

Health score

40/100

How it is scored
Activity
44
Community
47
Issues
21
Pull requests
47

+63 stars in the last 16 days

Overview

FinRL-Trading, presented as FinRL-X, is a Python infrastructure for building quantitative trading workflows across market data, portfolio strategies, backtesting, and brokerage execution. It addresses the gap between research prototypes and deployment by passing target portfolio weights between replaceable pipeline components and using those weights in both backtests and execution.

The project is aimed at quantitative finance researchers and practitioners who want to combine methods such as machine learning, deep reinforcement learning, and rule-based portfolio strategies. It can also serve as a starting point for teams that need data-source integrations and an Alpaca paper-trading workflow, but it is not a guarantee of trading performance.

Key Features

  • Modular pipeline for stock selection, portfolio allocation, timing adjustments, and risk overlays.
  • Shared target-weight interface intended to keep strategy outputs consistent between backtesting and execution.
  • Market-data integrations for Yahoo Finance, FMP, and WRDS, with SQLite caching described in the README.
  • Backtesting with benchmark comparisons and transaction costs.
  • Example allocation methods include equal weight, mean-variance, minimum variance, and PPO/SAC-based allocation.
  • Strategy examples cover ML stock selection and adaptive multi-asset rotation.
  • Alpaca integration for paper or live trading, including multi-account support and pre-trade risk checks.

Use Cases

  • Quantitative researchers can compare allocation approaches through a common portfolio-weight interface.
  • Strategy developers can test stock-selection and portfolio-allocation combinations against historical data before considering deployment.
  • Practitioners using Alpaca can explore paper-trading workflows that reuse strategy weights from backtests.
  • FinRL users evaluating a newer modular architecture can compare its data, strategy, and execution organization with the original framework.

Getting Started

Clone the repository, install its requirements, and run a sample backtest:

git clone https://github.com/AI4Finance-Foundation/FinRL-Trading.git
cd FinRL-Trading
pip install -r requirements.txt
./deploy.sh --strategy adaptive_rotation --mode backtest

See the README for setup options, API configuration, and strategy details. Paper or live trading requires Alpaca credentials.

Considerations

  • Trading strategies require reliable historical data; the README notes that manual setup may require CSV files, while the deployment script can download data.
  • Alpaca credentials are needed for paper or live execution. API keys for data sources may also be needed depending on configuration.
  • Historical backtests and paper-trading results are not evidence of future returns. The repository itself describes the software as for educational and research purposes and not financial advice.
  • The README specifies Python 3.11 or later and presents the project as a newer successor to FinRL, so users should verify compatibility and operational requirements for their environment before relying on it.

Found this useful?

Share it with someone who would like FinRL-Trading.

Comparisons