Cross-sectional multi-asset paper trading engine with per-asset XGBoost models, 17-layer governance framework, adaptive exit trailing, MetaTrader 5 bridge execution (Exness demo), and a React SPA dashboard. Every asset must survive expanding-window walk-forward validation before entering the live portfolio.
git clone https://github.com/manuelhorvey/EigenCapital.git
cd EigenCapital
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m paper_trading.ops.monitor # yfinance-only modeDashboard: http://localhost:5000
- Alpha is fragile; infrastructure robustness matters more.
- Every decision is validated by expanding-window walk-forward before touching live capital.
- Runtime execution is a systems-engineering problem, not a signal-generation problem.
- Determinism, replayability, train/serve symmetry, and per-asset isolation are non-negotiable.
The engine runs a continuous 6-phase orchestrator cycle (PRE + 5 numbered phases, every 60s) across 22 assets:
PRE: state snapshot → REFRESH: parallel inference → ADMIT: PEK gate →
VALIDITY: state updates → PORTFOLIO HEALTH: circuit breaker, VaR, orphan recon → PERSIST: WAL
Each asset runs an independent binary:logistic XGBoost model. Raw probabilities pass through P1 calibration (ECE 0.2207→0.0178 via DirectionalCalibrator), a 25-stage decision pipeline, 17 governance layers, and a multiplicative sizing chain before reaching the broker.
Full architecture → · Governance detail → · Feature reference →
22 assets promoted from a 36-asset research universe via walk-forward. Weights use factor_constrained_v2 (hard-linear factor constraints). Exits use trail_33pct retracement trailing (4-state: STATIC → breakeven lock → retracement trail → time decay).
Portfolio timeline:
| Date | Change |
|---|---|
| 2026-07-04 | BTCUSD (weekend-eligible, 24/7), AUDJPY, NZDJPY, GBPJPY, USDJPY added → 22 assets |
| 2026-06-30 | 11 assets bumped to ratio=3.0 via optimizer; all models retrained |
| 2026-06-26 | Trend-exhaustion features (6 new alpha) improved BuyWR; SELL_ONLY reduced 10→3 |
| 2026-07-01 | ES, NQ removed from portfolio (portfolio remediation) |
| 2026-06-22 | GBPUSD promoted (walk-forward IC 0.186) |
| 2026-06-20 | AUDNZD, EURUSD, AUDCHF, GBPNZD removed for directional instability |
Per-asset config (SL/TP, allocation, max_depth) in per-asset YAML files under configs/domains/assets/.
Full portfolio detail → · Mode reference →
⚠️ Two classes of metrics: R-space backtests (Sharpe 56.45) measure signal quality — independent per-asset R-multiples with no capital constraints, correlation, or slippage. The capital-growth simulation ($500 start, 1% risk, spread costs, min-lot constraints, adaptive exits) measures realistic portfolio performance. The latter is the production benchmark.
| Metric | Value | Type |
|---|---|---|
| Capital growth ($500 start) | $3,172 (+534%) | Realistic simulation |
| Sharpe (simulated) | 1.05 | Realistic simulation |
| Max Drawdown (simulated) | −34.9% | Realistic simulation |
| CAGR (simulated) | 45.1% | Realistic simulation |
| Profit Factor (simulated) | 1.27 | Realistic simulation |
| Total trades (8,494) | 40.7% WR, 0.31 expectancy | Realistic simulation |
| Signal quality (R-space Sharpe) | 56.45 | Signal quality only |
| Calibrated PnL | +732.73 R | Signal quality only |
| Assets profitable (calibrated) | 22/22 | Signal quality only |
| DirectionalCalibrator ECE | 0.2207→0.0178 | Calibration quality |
| Directional threshold improvement | +364.89 R vs no-gate baseline | Ablation study |
| Test suite | 3,899 passed, 0 failed | CI quality |
| Shock simulation | 17/21 PASS (correlated crash: SEVERE) | Stress test |
Capital growth simulation → · Robustness surface → · Institutional audit →
React SPA (TypeScript, Vite, Tailwind CSS) served on port 5000. 4 routes with single-primary-job surfaces:
| Route | Purpose |
|---|---|
/ |
Glance — status row, equity curve, open positions, sortable asset list |
/trading |
Operate — signal queue, admissions, recent trades, execution feed |
/execution |
Quality — equity curve, EIS/FQI scores, trade attribution |
/risk |
Governance — PEK telemetry, risk metrics, health scores |
API reference → · Monitoring → · Security →
| Variable | Required | Purpose |
|---|---|---|
PYTHONPATH |
Yes | Set to . |
MT5_ACCOUNT |
No* | Exness MT5 account number |
MT5_PASSWORD |
No* | Exness MT5 account password |
MT5_SERVER |
No* | Exness MT5 server |
EIGENCAPITAL_REFRESH_INTERVAL |
No | Engine loop interval (default 60s) |
EIGENCAPITAL_API_TOKEN |
No | Dashboard bearer auth token |
WINE_PREFIX |
No | Wine prefix path (default ~/.wine_mt5) |
MT5_BRIDGE_PORT |
No | Bridge TCP port (default 9879) |
* Required when mt5.enabled: true in config.
| Guide | Contents |
|---|---|
| Architecture | Full system design, orchestrator lifecycle, data flow |
| Governance | 17-layer framework, decision pipeline, sizing guardrails |
| Features | Alpha, regime, and archetype feature reference |
| Operations | Runbook, monitoring commands, troubleshooting |
| API Reference | All dashboard JSON endpoints |
| Security | Auth model, bridge security, secret management |
| Testing | Test suite structure and commands |
| Monitoring | Prometheus metrics reference |
| Development | Key scripts, benchmarks, contributing |
| Modes | Operating mode presets (production/FTMO/live) |
| Architecture Decisions | ADR index (23 records) |
| Changelog | Release history |
| Agent Guide | Full operational context for LLM agents |
- Paper trading only (MT5 Exness demo — no live capital)
- 6 permanent SELL_ONLY assets (CADCHF, EURAUD, EURCHF, GBPCHF, GBPJPY, NZDCHF) — BUY signal inversion confirmed permanent
- MT5 bridge requires Wine on Linux; single-threaded (RLock-serialized)
- Small MT5 demo ($107) → positions quantize to 0.01 lot minimum; desired-vs-actual diverges
- Circuit breaker at -15% DD or 7 consecutive losses; emergency halt auto-clears on recovery
- Spread gate in observe-only for first 720 cycles; enforcement activates automatically thereafter
MIT License. Research and paper-trading system only. Not financial advice.