π Official Production Platform & Monetization Portal: primeclub-quant.vercel.app
π Official Technical Wiki & Architecture Guide: github.com/ElMoorish/FinRL-X-MT5/wiki
Access real-time multi-agent deliberations, interactive prop challenge drawdown calculators, daily institutional recaps, and pre-trained production model checkpoints.
FinRL-X-MT5 is an institutional-grade algorithmic trading framework that adapts the Deep Reinforcement Learning principles of FinRL to MetaTrader 5.
It eliminates standard single-agent failure modes through the K-Dense Council: a 5-expert Mixture-of-Experts (MoE) architecture with NSGA-III Pareto-optimal gating, fusing high-frequency order-book microstructure with cross-asset equity/macro fundamental flows under the 100% Real Ticks backtesting standard.
FinRL-X-MT5 features a high-performance local web dashboard with real-time TradingView Lightweight Charts, a live 5-expert deliberation room, prop firm guardian circuit breaker gauges, and an autonomous step-by-step Chain-of-Thought (CoT) reasoning stream.
Dark Mode: Real-time Multi-Agent Deliberations, Prop Firm Guardian Gauges & Step-by-Step CoT Stream
White Mode: Clean Institutional Layout with Precision Tick Feed & Solvency Meters
Explore our comprehensive technical whitepapers covering machine learning topology, actuarial risk bounds, and regime classification:
- π Multi-Agent Reinforcement Learning for MetaTrader 5: Overcoming single-agent non-stationarity via the 5-Specialist Council and NSGA-III Pareto gating.
- π‘οΈ Defensive Capital Allocation & 0.50% Drawdown Guards: Mathematical position sizing, circuit breakers, and surviving prop firm evaluation limits.
- π Hidden Markov Models (HMM) for Regime Detection on NAS100: Gaussian HMM state decoding, Baum-Welch training, and filtering choppy consolidation.
Explore our comprehensive, production-grade technical documentation hosted on the GitHub Wiki:
- ποΈ Wiki Home: System Blueprint & Topology
- π§ 01. The 5-Agent Council Architecture β Deep dive into SAC, HMM, TimesFM, XGBoost, and PyMC Actuary.
- π‘οΈ 02. Risk Management Architecture & 0.50% Capital Ceiling β Sizing formulas, contract multipliers, and Rule 8.
- π― 03. The +1.0R Dynamic Breakeven Engine β Trailing stop mechanics and spread buffer defenses.
- β‘ 04. MetaTrader 5 Bridge Setup & Live Deployment Guide β Terminal flags,
.envcredentials, and daemon execution. - π 05. The Prop Firm Passkeeper Evaluation Protocol β 3-stage circuit breakers for FTMO and Goat Funded Trader.
- π₯οΈ 06. Local Monitoring Dashboard & Telemetry Server β FastAPI endpoints, WebSocket feeds, and ticket audits.
ββββββββββββββββββββββββββββββββββββββββββββββββ
β MT5 High-Frequency Ticks β
β + Yahoo/Macro Correlation Baskets β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β Correlation Fuser β
β (Polars M5 Matrix) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β β β
βββββββββββΌββββββββββ βββββββββββΌββββββββββ βββββββββββΌββββββββββ
β Expert 2 β β Expert 4 β β Expert 3 β
β HMM Regime β β SHAP + XGBoost β β TimesFM / EWMA β
β (Market State) β β (Signal Scorer) β β(Volatility Bands) β
βββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββ
β β β
βββββββββββΌββββββββββ β βββββββββββΌββββββββββ
β Expert 1 β β β Expert 5 β
β SAC DRL β β β Bayesian Actuary β
β (Action / Conv) β β β (Dynamic TP / SL) β
βββββββββββ¬ββββββββββ β βββββββββββ¬ββββββββββ
β β β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β NSGA-III Gate β
β (Pareto Ξ± Weighting)β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ
β Consensus Signal β
β (Direction & Size) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββββββββ΄βββββββββββββββββββββ
β β
βββββββββββΌββββββββββ βββββββββββΌββββββββββ
β Strategy Tester β β Live Socket β
β (Real-Tick CSV) β β Order Engine β
βββββββββββββββββββββ βββββββββββββββββββββ
| Specialist | Engine / Algorithm | Institutional Role | Mathematical Basis |
|---|---|---|---|
| E1 β The Trader | Soft Actor-Critic (SAC) | Directional weight & action conviction | Max-Entropy DRL with entropy regularization |
| E2 β The Oracle | Gaussian HMM (3-State) | Regime detection & position throttling | Bull / Bear / Consolidation hidden states |
| E3 β The Prophet | Google TimesFM 2.5 / EWMA | 60-min forward volatility envelope | Zero-shot deep forecasting & quantile projections |
| E4 β The Analyst | SHAP + XGBoost | Feature attribution & quality filter | Game-theoretic Shapley values on factor flows |
| E5 β The Actuary | Bayesian / Student's t | Dynamic Take-Profit & Stop-Loss levels | Posterior predictive credible intervals ( |
| The Gate | NSGA-III Genetic Algorithm | Optimal multi-objective expert blending | Pareto frontier: |
The framework supports multiple asset classes with automatic contract-size normalization and cross-asset correlation baskets:
- Commodities:
WTI.x(Crude Oil),XAGUSD.x(Silver Spot) - Indices:
NAS100.x,US30.x,SPX500.x,GER40.x,JAP225.x,UK100.x,AUS200.x - US Equities:
AAPL.x,NVDA.x,MSFT.x,AMZN.x,META.x,TSLA.x,PLTR.x
- Operating System: Windows 10/11 (Required for MetaTrader 5 Python IPC)
- MetaTrader 5 Desktop Terminal (Build 4000+)
- Python: 3.10 or 3.11 (64-bit)
- CUDA-compatible GPU (Recommended for DRL acceleration)
# Clone repository skeleton
git clone https://github.com/ElMoorish/FinRL-X-MT5.git
cd FinRL-X-MT5
# Install dependencies
pip install -r requirements_mt5.txtCopy .env.example to .env:
cp .env.example .env(Note: If your MT5 terminal is already open and logged in, python attaches automatically without needing credentials in .env)
Train a single instrument:
$env:PYTHONPATH="."
python -m src.main_mt5 train --symbol NAS100.x --days 60 --timesteps 20000Or train a batch of instruments across multiple asset classes:
python -m src.main_mt5 train --symbols WTI.x XAGUSD.x US30.x GER40.x AAPL.x NVDA.x --days 60 --timesteps 15000Generate aligned signals and automatically copy them to MT5's MQL5\Files\finrl_x_mt5\ directory:
python -m src.main_mt5 export-signals --symbol NAS100.x --days 60- Open MT5 and press
Ctrl + Rto open the Strategy Tester. - Select Expert:
FinRL_X_MT5. - Select Symbol:
NAS100.x, Timeframe:M5. - Set Model to:
Every tick based on real ticks. - Click Start to run the backtest.
Deep-dive documentation is available in the docs/ folder:
- System Architecture β Mathematical formulation of all 5 experts and NSGA-III gate.
- Data Pipeline & Fusion β Microstructure engineering and 1-day lagged fundamental cross-asset edge.
- MT5 Strategy Tester Guide β Step-by-step institutional real-tick backtesting protocol.
- Execution & Risk Management β Half-Kelly sizing, contract size normalization, and circuit breakers.
- Strategy Optimization Roadmap β Empirical levers to maximize Win Rate, Accuracy, and Profit Factor.
This repository skeleton contains NO private broker account numbers, passwords, server IPs, or proprietary client files.
.gitignorestrictly excludes.env,models/,logs/, SQLite databases, tick caches, and local MT5 data paths.- All credentials are abstracted via environment variables (
pydantic-settings).
For live execution signals, prop challenge passkeeper rules, pre-calibrated model weights, and institutional licensing, visit the official FinRL-X Prime Quant Portal:
- Tier 1: Prime VIP Alpha ($79/mo): High-conviction Council signals dispatched directly to private Telegram & Discord feeds with automated daily trade recaps and weekly macro tear-sheets.
- Tier 2: Prop Passkeeper ($199/mo): Strict 0.50% actuary lot sizing, pre-market New York bias reports, and challenge preservation governance.
-
Tier 3: Quant Pro Model Weights ($1,997): Direct checkpoint weights (SAC, Gaussian HMM, TimesFM, XGBoost, and Bayesian VaR) dropping right into the framework's
weights/directory. - Tier 4: Enterprise Bespoke ($9,977): Perpetual commercial license, multi-asset checkpoints, and rolling retraining pipeline code.
π Explore All Commercial Tiers & Model Checkpoints
If FinRL-X-MT5 has assisted your quantitative research, automated trading operations, or prop firm challenge evaluations, consider buying us a coffee or donating to support ongoing open-source R&D!
| Network | Asset / Token | Deposit Address |
|---|---|---|
| TRON (TRC20) | USDT (Tether USD) | TC8TFkemSFGEeBPF5ZQKbmjK97FVEGwrwc |
TRC20 Deposit Address:
TC8TFkemSFGEeBPF5ZQKbmjK97FVEGwrwc
Note
Network Notice: Please verify that you select the TRON (TRC20) network when sending USDT transfers. Every contribution directly funds GPU compute clusters for model training, tick data storage, and future reinforcement learning upgrades.
FinRL-X-MT5 is inspired by and builds upon the pioneering Deep Reinforcement Learning foundations of FinRL and FinRL-Trading developed by the AI4Finance Foundation.
While preserving the core financial reinforcement learning principles of the FinRL paradigm, this codebase introduces:
- MetaTrader 5 Real-Time Bridge: Seamless IPC connection to live MT5 terminals and Strategy Tester execution.
- 100% Real-Tick Backtest Protocol: Eliminates bar-interpolation artifacts by aligning Council signals to broker tick streams.
- The K-Dense Council (MoE): Softmax-weighted multi-expert gating (SAC DRL + 3-state HMM + TimesFM/EWMA + SHAP XGBoost + Bayesian Actuary) optimized via NSGA-III Pareto frontiers.
- Microstructure & Cross-Asset Fusion: High-frequency tick metrics combined with lagged ETF and macro factor baskets.
This project is licensed under the MIT License - see the LICENSE file for details.