FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance

Xiao-Yang Liu, Jingyang Rui, Jiechao Gao, Liuqing Yang, Hongyang Yang, Zhaoran Wang, Christina Dan Wang, Jian Guo · OpenReview

TL;DR

This paper introduces FinRL-Meta, a comprehensive framework designed to accelerate data-driven deep reinforcement learning (DRL) for financial market simulation. By providing a vast collection of near-real market environments and an efficient, multiprocessing training pipeline, FinRL-Meta aims to overcome the limitations of existing simulators and enable more robust DRL-based trading strategies.

What Problem Does This Paper Address?

Building accurate and reliable financial market simulators for DRL is a significant challenge. Raw historical financial data often contains noise and may not fully represent the dynamic nature of future markets, leading to degraded simulation fidelity. Furthermore, developing effective DRL agents requires a diverse set of market environments to capture various trading scenarios and participant behaviors. Existing approaches often lack this diversity and struggle with simulation speed, hindering the exploration of DRL's full potential in quantitative finance.

Methods

FinRL-Meta tackles these challenges through a three-pronged approach:

  • DataOps for Data-Driven DRL: The framework adopts the DataOps paradigm to create a unified and automated data engineering pipeline. This pipeline efficiently accesses, cleans, and engineers features from diverse financial data sources, ensuring high-quality data for DRL agents. This approach enhances agility in model deployment.
  • Universe of Market Environments: FinRL-Meta provides hundreds of near-real market environments tailored for various trading tasks, including high-frequency trading, cryptocurrency trading, and stock portfolio allocation. These environments are directly connected to the data processor, allowing for efficient generation of large datasets.
  • Multiprocessing Training: To accelerate the training of DRL agents on these large datasets, FinRL-Meta leverages thousands of GPU cores for multiprocessing training. This significantly speeds up the simulation and training process.

The framework also emphasizes a "Plug-and-Play" design, separating market environments from data and agent layers, allowing for easy integration and comparison of different DRL agents. A "Training-Testing-Trading Pipeline" is employed to ensure robust agent validation and prevent information leakage.

Datasets

The paper utilizes various data sources for its environments, including:

  • Yahoo! Finance: For US Securities data.
  • CCXT: For cryptocurrency data.
  • WRDS.TAQ: For US Securities intraday trades.
  • Alpaca: For US Stocks and ETFs.
  • RiceQuant: For CN Securities data.
  • JoinQuant: For CN Securities data.
  • QuantConnect: For US Securities data.

For evaluation, the paper uses:

  • Stock Trading: 30 constituent stocks of the Dow Jones Industrial Average (DJIA). Data from 06/01/2021 to 08/31/2021 for training and validation, with paper trading from 09/03/2021 to 09/16/2021.
  • Cryptocurrency Trading: Top 10 market cap cryptocurrencies (excluding stablecoins). Data from 06/01/2021 to 08/31/2021 for training and validation, with paper trading from 09/01/2021 to 09/15/2021. Bitcoin (BTC) is used as a baseline for cryptocurrency trading.

Key Insights and Ideas

  • DataOps is Crucial for DRL in Finance: The paper highlights that a robust and automated data engineering pipeline is fundamental for building effective DRL-based financial simulators, enabling better data quality and faster iteration.
  • Diversity of Environments is Key: The sheer number and variety of market environments provided by FinRL-Meta are presented as a significant advantage, allowing for more comprehensive testing and development of DRL agents that can adapt to different market conditions.
  • Scalability Through Multiprocessing: The successful application of multiprocessing training demonstrates that significant speedups are achievable, making it feasible to train complex DRL models on large financial datasets.
  • Separation of Concerns: The "Plug-and-Play" architecture and the distinct layers (data, environment, agent) promote modularity and reusability, fostering a collaborative ecosystem for DRL in finance.

Key Results

The paper demonstrates satisfactory trading performance for various tasks:

  • Stock Trading: Both ElegantRL and Stable-baselines3 agents outperformed the DJIA baseline in both annual return and Sharpe ratio during backtesting and paper trading. For instance, the ElegantRL agent achieved an annual return of 22.425% and a Sharpe ratio of 1.457.
  • Cryptocurrency Trading: The ElegantRL agent significantly outperformed the Bitcoin (BTC) benchmark in backtesting and paper trading, achieving an impressive annual return of 360.823% and a Sharpe ratio of 2.992.

Limitations and Future Work

Limitations:

  • The paper focuses on near-real market environments, and while it aims to mitigate issues with raw historical data, the inherent complexities and unpredictability of real-world markets may still pose challenges.

Future Work:

The authors envision a "FinRL-Metaverse" that will:

  • Scale to Tens of Thousands of Agents: Build a multi-agent market simulator with a massive number of agents to better represent complex market dynamics.
  • Employ GPU-Based Massive Parallel Simulation: Utilize technologies like Isaac Gym for enhanced simulation performance.
  • Explore Evolutionary Perspectives: Investigate evolutionary approaches to further enhance market simulation.
  • Provide Insights for Financial Regulations: Aim to offer deeper understanding of complex market phenomena and inform financial regulations.

Summary updated

BibTeX
@misc{liu2021finrl,
  author = {Xiao-Yang Liu and Jingyang Rui and Jiechao Gao and Liuqing Yang and Hongyang Yang and Zhaoran Wang and Christina Dan Wang and Jian Guo},
  title = {{FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance}},
  year = {2021},
  eprint = {2112.06753},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.06753},
}
Figure