Discover and explore top open-source AI tools and projects—updated daily.
AminHPOpenAI Gym trading env for MetaTrader 5, enabling RL-based trading algorithms
Top 62.3% on SourcePulse
This project provides a flexible, general-purpose simulator and OpenAI Gym environment for algorithmic trading strategies using the MetaTrader 5 platform. It caters to reinforcement learning researchers and traders looking to backtest and analyze strategies with a focus on code readability and end-to-end trading process management.
How It Works
The core is MtSimulator, which mimics MetaTrader 5's trading logic, including order management, balance, equity, and margin calculations. It can download historical data via the MetaTrader5 Python package (Windows-only) or use custom data sources. The MtEnv class wraps MtSimulator into a standard Gym environment, processing historical price data into features and defining complex action/observation spaces suitable for RL algorithms. It handles data windows, feature extraction, and reward calculation.
Quick Start & Requirements
pip install gym-mtsimdownload_data) is Windows-only due to the MetaTrader5 package dependency.pip install stable-baselines3Highlighted Details
human, simple_figure, advanced_figure).Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
download_data functionality is restricted to Windows due to the MetaTrader5 Python package.11 months ago
Inactive
facebookresearch
Yvictor