A production-grade, multi-scale Mixture of Experts (MoE) trading framework with Continuous Softmax Correlation-Aware Weighting (CAW), Volatility-Adaptive Breakeven Ratchet, and Continual ReCAP Adaptation with guaranteed zero catastrophic forgetting.
Official Portal β’ Wiki Docs β’ Key Features β’ System Architecture β’ Verified Benchmark β’ Quickstart β’ Pretrained Models β’ Support & Grants β’ Documentation
Traditional single-domain quantitative strategies suffer from alpha decay:
- Technical models overfit to noise during choppy, low-volatility consolidation.
- Macro models lag fast intraday liquidation cascades.
- Sentiment engines react too late to high-frequency order flow imbalances.
TriDomainMoE solves this fundamental breakdown by decoupling market dimensions into three specialized deep neural experts coordinated by a Continuous Softmax Correlation-Aware Router (CAW):
-
Microstructure Tech Expert: Dilated Causal Convolutions (
$d=1, 2$ ) capturing intra-bar order book absorption, Volume-Synchronized OFI, and Parkinson High-Low Volatility ratios with zero future lookahead bias. - Macro Term Structure SSM: State-space linear recurrence initialized with a HiPPO log-spaced timescale prior spectrum, naturally retaining multi-day and multi-week secular cycles.
- Fundamental Crypto Sentiment: Deep gated residual highway modeling narrative momentum and continuous 24-hour Cumulative Volume Delta (CVD) flows.
βββββββββββββββββββββββββββββββββββββββββββ
β Live MT5 Tick & Bar Streams β
β (Continuous 24/7 Market) β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Microstructure Features ββ Macro Cross-Asset SSM ββ Fundamental Sentiment β
β β’ Dilated Causal Conv ββ β’ HiPPO Recurrence Block ββ β’ Gated Residual Highway β
β β’ Parkinson Vol Ratio ββ β’ H4 / D1 Secular Trend ββ β’ 24h Net CVD Flow β
β β’ Fractional Diff (d=0.45) ββ β’ Vol Term Slope ββ β’ News Decay Kernel z_t β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ¬βββββββββββββββ
β β β
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Continuous Softmax CAW Router (8D z) β
β + Cosine Repulsion Diversity Loss β
β + Unconditional Drift Base Forecaster β
β + Calibrated Conviction Meta-Sizer β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Institutional Risk & Pre-Trade Gating β
β β’ Vector 1: Anti-Adverse Book Shield β
β β’ Vector 2: Volatility BE Ratchet β
β β’ Vector 3: Router Entropy Gate β
β β’ Vector 4: London/NY Overlap Boost β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β MT5 Bridge & Bracket Execution β
β (Strict Single-Deal Risk Ceiling) β
βββββββββββββββββββββββββββββββββββββββββββ
TriDomainMoE incorporates four institutional safeguards developed directly from microstructural empirical research:
-
Vector 1: Pre-Trade Anti-Adverse Order Book Shield:
- Rejects BUY signals when
normalized_ofi < -0.20orvpin > 0.65. - Rejects SELL signals when
normalized_ofi > +0.20orvpin > 0.65. - Protects against toxic informed flow dumping into limit orders.
- Rejects BUY signals when
-
Vector 2: Volatility-Adaptive Breakeven Ratchet:
- Once unrealized profit reaches
$50%$ of TP distance ($+1.5\sigma$ ), Stop-Loss is automatically moved to$\text{Entry} + \text{Spread} + 2\text{ points}$ . - Converts potential round-trip winners into guaranteed non-negative scratches (+$0.60 to +$0.77 net on 0.01 micro-lots).
- Once unrealized profit reaches
-
Vector 3: Router Shannon Entropy Filter:
- When router entropy
$H(g) \ge 1.00$ (experts in conflict during sideways chop), requires a higher conviction drift threshold ($|y_{\text{pred}}| \ge 0.038$ instead of$0.030$ ).
- When router entropy
-
Vector 4: London / NY Overlap Sizing Boost:
- Dynamically scales conviction sizing by
$+15%$ between 12:00 and 18:00 UTC during deepest global liquidity.
- Dynamically scales conviction sizing by
Evaluated across 105,078 real consecutive M5 bars (September 12, 2025 β September 12, 2026) using high-resolution tick spreads and dynamic friction:
| Metric | Measured Value | Benchmark / Target | Institutional Compliance |
|---|---|---|---|
| Continuous Dataset Span | 105,078 M5 Bars | 365 Days (24/7) | 100% Full-Year Coverage |
| Total Executed Trades | 443 | Selective Execution | Pruned 475 choppy false alarms |
| Win Rate | 75.85% (336 W / 107 L) | EXCEEDED | |
| Profit Factor | 3.37 | CONFIRMED ($2,156.51 Gross Win vs $639.26 Loss) | |
| Max Trailing Drawdown | 0.3753% ($38.03 cash) |
|
PASSED (Massive 6.6x Safety Buffer) |
| Deflated Sharpe Ratio (DSR) | 1.0000 | STATISTICALLY SIGNIFICANT ( |
|
| Annualized Sharpe | 9.47 | INSTITUTIONAL GRADE | |
| Annualized Sortino | 39.05 | MINIMAL DOWNSIDE VOLATILITY | |
| Calendar Consistency | 13 / 13 Positive Months | 100% Profitable | Zero Negative Months |
| Net Return | +15.17% | Conservative 0.10% Risk | Scales linearly with risk parameter |
TriDomainMoE was independently benchmarked and audited using the WalkForward Quant institutional verification engine against Robert Pardo's Walk-Forward Efficiency framework, Bailey & LΓ³pez de Prado's Deflated Sharpe Ratio (DSR), CSCV Probability of Backtest Overfitting (PBO), and Prop Firm challenge rules:
| Metric | TriDomainMoE v1 Baseline (BTCUSD.x) |
TriDomainMoE v2 Enhanced (BTCUSD.x) |
FinRL-X-MT5 KDense Council (NAS100.x) |
|---|---|---|---|
| Asset Under Audit |
BTCUSD.x (Bitcoin) |
BTCUSD.x (Bitcoin) |
NAS100.x (Nasdaq 100) |
| Total Trades | 2,209 | 774 | 2,476 |
| Win Rate (%) | 46.31% | 57.75% | 57.39% |
| Profit Factor | 1.24 | 1.70 | 1.16 |
| Net Profit ($) | +$1,421.40 | +$1,581.16 | +$3,697.55 |
| Historical Max Drawdown (%) | 2.31% | 1.41% (Ultra-Low) | 6.53% |
| Monte Carlo P99 Max DD | 2.31% | 1.41% | 10.89% |
| FTMO Max Daily Loss | $780.12 (0.78%) | $394.88 (0.39%) | $2,230.59 (2.23%) [Limit: $5k] |
| FTMO Max Total DD | $2,305.47 (2.31%) | $1,407.19 (1.41%) | $6,532.32 (6.53%) [Limit: $10k] |
| Robert Pardo WFE | 85.8% | 79.5% | 143.2% |
| WFE Classification | High Consistency | High Consistency | High Consistency |
| Deflated Sharpe (DSR) | 0.987 | 0.997 | 0.939 |
| DSR Passed ( |
PASSED | PASSED | Borderline (0.939) |
| CSCV PBO Overfitting | 0.6% | 0.1% | 2.7% |
| FTMO 100k Challenge | PASSED | PASSED | PASSED |
| Toxic Lot Scanner | TOXIC (Unhedged tail risk) | CLEAN | CLEAN (Zero Martingale/Grid) |
| Parameter Half-Life | 1,000 days | 252 days | 1,000 days |
| Deployment Verdict | GRADE B (CONDITIONAL) | GRADE A (INSTITUTIONAL PRODUCTION) | GRADE B (STAGED DEPLOYMENT) |
- Zero Curve-Fitting (DSR = 0.997 & PBO = 0.1%): TriDomainMoE v2 demonstrated statistically verified edge survival after adjusting for selection bias and non-normal return distributions.
-
Pardo WFE Retention (79.5% - 85.8%): Far exceeding the institutional benchmark threshold of
$50% - 70%$ , proving that performance translates smoothly from in-sample calibration to out-of-sample live execution. - Prop Firm Solvency: Full compliance with the FTMO 100k Challenge rules under strict single-deal drawdown guardrails.
git clone https://github.com/ElMoorish/TriDomainMoE.git
cd TriDomainMoE
# Create environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# or: .venv\Scripts\activate # Windows
# Install package in editable mode
pip install -e .Copy .env.example to .env:
cp .env.example .env(Optional: configure MT5 connection credentials if running on a remote headless server).
python scripts/run_long_duration_backtest.py \
--symbol BTCUSD.x \
--days 365 \
--timeframe M5 \
--enhanced \
--breakeven-ratchetTo launch the real-time MetaTrader 5 execution engine:
python scripts/live_mt5_trader.py \
--symbol BTCUSD.x \
--timeframe M5 \
--no-paper \
--interval 5 \
--weights weights/btcusd_tri_domain_v2.pt \
--risk-pct 0.0020 \
--enhanced \
--breakeven-ratchetLaunch the Goldman/Bloomberg-grade telemetry web console on port 8888:
python scripts/serve_dashboard.pyOpen http://localhost:8888 to access:
- Real-time MT5 balance, equity, and margin telemetry.
- Live Order Flow Imbalance (OFI) & Wavelet Energy Drift (MRDD) surveillance.
- Interactive Daily Trade Performance breakdown with date search and quick filters.
- 4 Curated Themes: Obsidian Sapphire π, Stealth Carbon β‘, Midnight Gold π, Bloomberg Terminal π.
TriDomainMoE implements the Regime-Aware Continual Adaptive Portfolio (ReCAP) framework:
- Baseline neural weights
$\theta_0$ remain permanently frozen (requires_grad = False). - Adaptation isolates modular parameter policy delta vectors:
$$d_k = \theta_k - \theta_0$$ - At runtime, active network parameters are synthesized dynamically:
$$\theta_{\text{active}} = \theta_0 + \sum_{k=1}^K w_k \cdot d_k$$ - Guarantees 0.00% catastrophic forgetting of historical base market representations.
Pretrained model checkpoints, encoders, and discrete codebooks are published on the Hugging Face Hub at ElMoorish/tri-domain-moe:
| Checkpoint Name | Description | Size | Hub Path |
|---|---|---|---|
btcusd_tri_domain_v2.pt |
Enhanced Live v2 Production Model | 210 KB | ElMoorish/tri-domain-moe/weights/btcusd_tri_domain_v2.pt |
btcusd_advanced_v1.pt |
MBM + VQ-VAE + Microstructure v3 Model | 1.5 MB | ElMoorish/tri-domain-moe/weights/btcusd_advanced_v1.pt |
mbm_encoder_v1.pt |
Masked Bar Modeling 4-Layer Transformer | 3.3 MB | ElMoorish/tri-domain-moe/weights/mbm_encoder_v1.pt |
vq_tokenizer_v1.pt |
Discrete Market State Codebook (K=128) | 1.1 MB | ElMoorish/tri-domain-moe/weights/vq_tokenizer_v1.pt |
recap_policies.pt |
Modular Continual ReCAP Policy Library | 204 KB | ElMoorish/tri-domain-moe/weights/recap_library/recap_policies.pt |
To upload additional checkpoints directly to your Hugging Face account:
python scripts/upload_to_huggingface.py --repo-id ElMoorish/tri-domain-moeTriDomainMoE is part of the PrimeClub Quant algorithmic ecosystem. Visit the official web portal for real-time portfolio dashboards, research articles, and multi-agent execution telemetry:
π Official Web Portal: https://primeclub-quant.vercel.app/
Developing, pretraining, and live-forward testing institutional algorithmic intelligence requires continuous 24/7 high-performance GPU compute (NVIDIA RTX 4060 / cloud H100 clusters), low-latency MT5 broker tick execution data feeds, and institutional news streaming infrastructure.
If TriDomainMoE or FinRL-X-MT5 provides value to your research or trading operations, supporting the project directly accelerates our live forward validation, multi-asset extensions (NAS100, XAUUSD, ETHUSD), and open-source model releases.
| Detail | Specification |
|---|---|
| Asset | USDT (Tether USD) |
| Network | TRON (TRC20) |
| Deposit Address | TC8TFkemSFGEeBPF5ZQKbmjK97FVEGwrwc |
TRC20 USDT Address:
TC8TFkemSFGEeBPF5ZQKbmjK97FVEGwrwc
Important
Please ensure you transfer USDT strictly over the TRON (TRC20) network. Transfers sent over other networks (ERC20, BSC, Solana, etc.) cannot be recovered. All grants go directly toward server compute, real tick data procurement, and live forward execution infrastructure.
Verify all 25 mathematical, structural, and execution unit tests:
pytest tests/ -vDistributed under the Apache License 2.0. See LICENSE for details.
Caution
Quantitative Research Disclosure: This software is provided for scientific, academic, and algorithmic trading research purposes. Algorithmic trading in cryptocurrencies, indices, and derivatives carries substantial financial risk. Past statistical backtest performance is not an absolute guarantee of future live execution returns. Always practice strict capital preservation.