How ai4finance-foundation/finrl-meta works
Project type and purpose
• FinRL-Meta is an open-source framework and benchmarking library for data-driven financial reinforcement learning. It provides a “metaverse” of market environments (stock, crypto, futures, FX, portfolio optimization, execution) and prebuilt pipelines for training, testing, and trading DRL agents.
• Key indicators: three-layer architecture (data, environment, agent), plug-and-play support for multiple DRL libraries (ElegantRL, Stable-Baselines3, RLlib), dozens of demos and benchmarks.
File structure
• Top-level directories
• agents/ – wrappers for different DRL libraries
• meta/ – core modules: data processing (meta/data_processors), environment implementations (meta/env_*), configuration
• examples/ – demo notebooks and scripts showing how to run environments and agents
• docker/ – container build & run scripts
• unit_tests/ – data-source validation tests
• main.py, train.py, test.py, trade.py – orchestrators for the training-testing-trading pipeline
• Config and build files
• requirements.txt, setup.py – packaging & dependencies
• .github/workflows – CI for linting and Python tests
• figs/ – reference images for documentation
• Patterns
• Layered architecture: data layer (data fetching & processing), environment layer (gym-style envs), agent layer (algorithmic wrappers)
• Plug-and-play design: agents/<library> imports meta/env_* environments via a unified interface
README for additional insights
• Three logical layers:
1) Data layer: raw data ingestion via many APIs → preprocessed OHLCV + features
2) Environment layer: gym environments for different markets/use cases
3) Agent layer: algorithms from multiple DRL frameworks
• Training-Testing-Trading pipeline with strict separation of time windows
• DataOps pipeline: automated end-to-end data processing, sampling, and monitoring