Six named intelligence agents independently analyze every instrument and cast directional votes. The Arbiter aggregates votes through a 9-layer guard system (including market hours check, R:R enforcement, and ML trade filter), and requires a minimum consensus of 3 agents (50%) before any trade is entered. No single agent can trigger a trade alone. All execution is via IG Group CFD account with a £100,000 virtual bankroll for position sizing.
| Agent | Role | Description | Data Sources | Cycle |
|---|---|---|---|---|
| Sentinel | Market Scanner | Monitors real-time prices, spreads, and volume across all instruments. Detects unusual price movements, spread widening, and momentum shifts. First line of market awareness. | IG live prices, volume, spread | 5 min |
| Atlas | Macro Strategist | Analyses the macroeconomic environment. Detects regime changes using yield curves, inflation data, employment figures, and central bank signals. Maps macro conditions to asset class positioning. | FRED economics, economic calendar | 30 min |
| Cipher | Technical Analyst & Gate | Runs multi-timeframe technical analysis using 6 indicators (Ichimoku, Bollinger, RSI, EMA, MACD, VWAP) on all active instruments. Produces composite directional signals across DAY, 4H, and 15M timeframes. Also detects market regime (trending/ranging/volatile) used by the Regime Gate. | IG candles (DAY, 4H, 15M) | 15 min |
| Oracle | Fundamental Analyst | Evaluates supply/demand fundamentals, positioning data, crowd probabilities, and geopolitical events. Provides the longest-horizon view with deep fundamental reasoning. Our strongest edge — CFTC + weather + USDA data provides genuine information advantage. | CFTC, USDA, weather, news, Polymarket | 1 hour |
| Pulse | Sentiment Reader | Reads market mood from multiple angles: crowd fear/greed, retail positioning via IG client sentiment, and news sentiment. Acts as a contrarian filter when sentiment reaches extremes. Incorporates crowd-fading logic from the retired Contrarian agent. | Fear & Greed, IG sentiment, news | 15 min |
| Structure | Market Microstructure | Analyses market structure using Wyckoff phase detection, volume profile (POC/Value Area), swing high/low patterns (HH/HL/LH/LL), and support/resistance levels from price clustering. Provides a fundamentally different perspective from indicator-based agents. | IG candles (DAY, 4H) | 15 min |
| Arbiter | Consensus Judge | Collects all 6 voting agent votes within the vote window. Runs 9-layer guard system (Market Hours, Event Guard, Anti-stacking, Daily cap, Cooldown, Regime gate, Volatile regime, Instrument restrictions, R:R enforcement). Filters low-confidence votes (below 0.25). Requires 3+ agents consensus. Calculates Kelly criterion edge with regime multiplier. ML filter gate blocks low-probability trades (<15%) and boosts high-probability ones (>40%). Self-improving: weekly retrain compares accuracy/AUC delta, recalibrates thresholds, and sends Telegram report. | All agent votes + guards + ML filter + historical performance | 15 min |
The Agent Council filters out noise by requiring agreement from multiple independent perspectives before entering any position. A single agent's conviction, no matter how strong, cannot trigger a trade. With 6 voting agents and a minimum of 3 required, this means 50% agreement is needed.
Conviction scaling directly determines position size. More agents in agreement means higher conviction and a larger allocation (out of 6 voting agents):
How consensus is formed:
In this example, Sentinel, Atlas, Oracle, and Structure agree on BUY (4/6) while Cipher dissents with SELL and Pulse is neutral. The Arbiter records a BUY consensus at conviction level 4 with a 1.5x position size multiplier. Dissenting views are stored in the consensus_decisions table.
9-Layer Guard System: Even when consensus is achieved, the trade must pass through all guards before execution:
Blocked trades are still recorded in consensus_decisions with status='blocked' and the specific guard that rejected them. This provides an audit trail and allows post-hoc analysis of whether blocked trades would have been profitable.
7 active instruments are traded via IG Group CFD account. Focus is on commodities (proven edge via CFTC/weather/USDA data) and select indices with restrictions. All forex has been removed after 305 combined trades producing £2.29 total PnL. The table below is fetched live from the API.
| Instrument | Asset Class | Leverage | Spread (pts) | Hours |
|---|---|---|---|---|
| Loading instruments... | ||||
Positions are sized using the fractional Kelly criterion at 35% of the full Kelly recommendation, combined with conviction-based multipliers from the Agent Council. The edge calculation is now based on historical performance (30-day rolling) rather than a synthetic formula. Multiple hard caps ensure no single trade can cause outsized damage.
Conviction multipliers scale the base position size (out of 6 voting agents):
| Agents Agree | Conviction | Multiplier | Max Per Trade (balanced) |
|---|---|---|---|
| 3 of 6 | Standard (50%) | 1.0x | up to £1,000 |
| 4 of 6 | Moderate (67%) | 1.5x | up to £1,500 |
| 5 of 6 | High (83%) | 2.5x | up to £2,500 |
| 6 of 6 | Maximum (100%) | 3.5x | up to £3,500 |
All sizes are still capped at 5% of bankroll margin (£5,000). The “balanced” strategy preset is active on the CFD account.
Instrument restrictions provide additional per-instrument guardrails:
| Instrument | Restriction | Rationale |
|---|---|---|
| FTSE100 | SELL-only, min conviction 3 | Historical BUY trades lost heavily; SELL direction had best wins |
| SP500 | Trending regime only | New instrument — protected with regime gate until track record established |
| NAS100 | Trending regime only | New instrument — protected with regime gate until track record established |
Cipher runs multi-timeframe technical analysis on every active instrument using 6 indicators from the ta library. Each indicator produces a directional signal between -1.0 (strong sell) and +1.0 (strong buy). ATR is used as a modifier for confidence and stop distances, not as a directional signal. Cipher also performs regime detection (trending/ranging/volatile) used by the Arbiter's Regime Gate.
| Indicator | Weight | Role | Implementation |
|---|---|---|---|
| Ichimoku Cloud | 30% | Trend direction (price vs kumo, tenkan/kijun cross, chikou span) | ta.trend.IchimokuIndicator |
| Bollinger Bands | 15% | Mean reversion (%B position, band width, squeeze detection) | ta.volatility.BollingerBands |
| RSI (14) | 15% | Momentum (oversold/overbought, divergence from price) | ta.momentum.RSIIndicator |
| EMA Cross (9/21) | 15% | Trend confirmation (fast/slow EMA crossover and spread) | ta.trend.EMAIndicator |
| MACD | 15% | Momentum + divergence (MACD line vs signal, histogram direction) | ta.trend.MACD |
| VWAP | 10%* | Institutional flow (price position relative to volume-weighted average) | ta.volume.VolumeWeightedAveragePrice |
| ATR | modifier | Adjusts confidence ±0.1 and stop distances. Not directional. | ta.volatility.AverageTrueRange |
* When volume data is unavailable, VWAP weight drops to 0% and the remaining 5 indicators are redistributed proportionally (33% / 17% / 17% / 17% / 16%).
Multi-timeframe weights: Cipher analyses three timeframes and combines them into a single directional signal.
| Timeframe | IG Resolution | Weight | Role |
|---|---|---|---|
| DAY | Daily candles | 40% | Trend direction — sets the overall bias |
| HOUR_4 | 4-hour candles | 30% | Structure — confirms or refutes daily trend |
| MINUTE_15 | 15-minute candles | 30% | Entry timing — fine-grained momentum for entries |
Edge naturally decays as a position ages. The system uses a quadratic decay function that starts slow and accelerates — matching the intuition that information becomes stale faster over time. When effective edge drops below the threshold, the position is exited.
Maximum hold periods vary by asset class, reflecting the typical information half-life for each market:
| Asset Class | Max Hold | Rationale |
|---|---|---|
| forex | 96 hours (4d) | Macro themes shift quickly; short-term mean reversion dominates |
| indices | 144 hours (6d) | Moderate holding period; earnings and data releases drive regime |
| commodity | 336 hours (14d) | Supply/demand fundamentals evolve over days to weeks |
Decay examples for a 10% raw edge across different hold durations:
| Hold Time | Age Ratio | Decay Factor | Effective Edge | Status |
|---|---|---|---|---|
| 0h (entry) | 0.00 | 100% | 10.0% | Active |
| 25% of max | 0.25 | 93.8% | 9.4% | Active |
| 50% of max | 0.50 | 75.0% | 7.5% | Active |
| 75% of max | 0.75 | 43.8% | 4.4% | Below threshold → EXIT |
| 100% of max | 1.00 | 0.0% | 0.0% | Max hold → FORCE EXIT |
Hard limits that halt all trading when triggered. These are non-negotiable safety mechanisms — the autonomous system cannot override them. Each breaker independently blocks new trade execution.
What happens when each breaker triggers:
skipped. No new positions are opened until the next trading day (UTC midnight reset). Existing positions remain open with normal exit rules.
Circuit breaker status is visible in real-time on the dashboard's POSITIONS tab, with bar charts showing current usage against limits.
Every trade executed by Mercurius has a complete reasoning chain stored in the database and visible in the Trade Log. This ensures full transparency — no black box decisions. The chain records the path from raw data to trade execution.
agent_votes table.
consensus_decisions table.
Click any trade in the dashboard Trade Log to expand its full reasoning chain. Every field is queryable via the Intelligence Terminal using natural language.
Positions are monitored continuously and exited when any of the following conditions are met. The position manager checks these rules on every cycle (every 5 minutes for active positions).
| Exit Rule | Condition | Priority | Description |
|---|---|---|---|
| Take Profit | 85% of target | 1 | Lock in profits at 85% of the original target move. Research from Polymarket analysis shows that waiting for 100% leaves significant profit on the table due to mean reversion. |
| Stale Thesis | 24h + <2% move | 2 | If the position has been open for 24 hours and price has moved less than 2% from entry, the thesis is considered stale. The market has not confirmed the edge and capital should be freed. |
| Consensus Reversal | Direction flips | 3 | If the Agent Council reaches a new consensus in the opposite direction of the open position, the position is exited immediately. The collective intelligence has changed its view. |
| Max Hold Period | Per asset class | 4 | Forex: 96h (4d), Indices: 144h (6d), Commodity: 336h (14d). Forces capital rotation and prevents indefinite holds on decaying edges. |
| Edge Threshold | Effective edge < 8% | 5 | When the time-decayed effective edge drops below 8% (the entry threshold), the position no longer justifies the risk. Exit regardless of P&L status. |
Exit priority: When multiple exit conditions trigger simultaneously, the highest priority rule (lowest number) determines the recorded exit reason. All applicable conditions are still logged for analysis.
Every agent is scored on accuracy using an Exponential Moving Average (EMA) that weights recent performance more heavily. Scores are tracked per agent, per instrument, and per market regime. Weights influence the Arbiter's consensus calculation.
Weight lookup priority: The Arbiter looks up agent weights in this order: (1) agent + instrument + regime, (2) agent + instrument, (3) agent global, (4) default 1.0. This ensures that an agent proven accurate on a specific instrument in a specific regime gets the highest influence.
Weighted consensus: In addition to the raw vote count (≥3 of 6 agents), a consensus can also trigger when 3+ agents agree and their combined weighted score ≥ 2.5. This rewards agents with strong track records. Votes below 0.25 confidence are filtered out before consensus counting.
Self-improvement loop: A daily job (06:00 UTC) scans agent_scores for agent-instrument combos with 20+ evaluations and <30% accuracy, auto-capping their weight to MIN_WEIGHT (0.2). This closes the feedback loop that strategy reviews had been recommending but never implementing.
Every 15 minutes, each instrument is classified into one of three market regimes using a combination of ADX (trend strength), ATR (volatility), and Bollinger Band width. The detected regime directly gates trade execution via the Regime Gate (Layer 5 of the guard system) and influences agent weights.
| Regime | Detection | Effect |
|---|---|---|
| Trending | ADX > 25 | All trades allowed. Trend-following agents (Cipher, Sentinel) get higher weight. Wider stops allowed. SP500/NAS100 only trade in this regime. |
| Volatile | ATR above 1.5× 20-period average OR BB width in top quartile | Requires conviction ≥4. Tradeable but needs stronger consensus. Position sizes reduced. |
| Ranging | Default (neither trending nor volatile) | BLOCKED for indices. Commodities pass through (fundamental edge persists regardless of technical regime). FTSE100 is exempt from the regime gate. Historical ranging WR: 8.3%. |
Before deploying to live trading, Mercurius enforces a preflight checklist and graduated safety measures. These ensure the system has been thoroughly validated in paper mode before risking real capital.
Preflight checklist (all 8 must pass before live mode is activated):
Emergency stop can be triggered via the dashboard kill switch or CLI (python -m mercurius stop). It immediately closes all open positions at market price and halts the scheduler. Available via POST /api/emergency-stop.
The Event Guard is a gatekeeper agent that does not vote directionally. Instead, it votes BLOCK or CLEAR per instrument. When a BLOCK is active, the Arbiter will not execute trades even if consensus exists. The trade is recorded as "blocked" and deferred.
Data sources: Economic calendar (high-impact events), Nager.Date API (market holidays), and NFP first-Friday pattern detection.
Currency mapping: USD events block SP500, NAS100, XAU/USD, XAG/USD, OIL_BRENT. GBP events block FTSE100. Events are mapped to active instruments only.
Intermarket correlations are monitored as context for the remaining agents (particularly Oracle and Atlas) rather than as a standalone voting agent. The dedicated Correlation agent was retired in May 2025 due to 11-27% accuracy, but the relationships remain relevant reference data.
| Reference | Instrument | Expected Correlation | Used By |
|---|---|---|---|
| Dollar Index (DXY) | XAU/USD | Negative | Oracle (fundamental context) |
| VIX | SP500 | Negative | Atlas (macro regime) |
| Dollar Index (DXY) | OIL_BRENT | Negative | Oracle (fundamental context) |
| Gold (GC=F) | XAG/USD | Positive | Oracle (precious metals) |
Contrarian logic is now embedded within the Pulse agent rather than operating as a standalone agent. When IG client sentiment exceeds 75% one-sided, or Fear & Greed hits extremes (>85 greed or <15 fear), Pulse factors this as a contrarian signal in its vote. This consolidation reduced noise while preserving the signal.
The Reviewer agent is NOT a voting agent. It runs on a separate schedule and provides two types of analysis:
Metrics computed: Total P&L, win rate, profit factor, Sharpe ratio, max drawdown, expectancy, average winner/loser, R-multiple, best/worst streaks, time-in-trade distribution, and agent accuracy by regime.
All reviews are stored in the strategy_reviews table and visible in the REVIEW tab of the dashboard. The review provides a continuous feedback loop for the trading system, identifying what's working, what isn't, and what to adjust.
Self-improving ML pipeline: The XGBoost trade filter retrains weekly (Sunday 23:00 UTC) on all closed positions. Each retrain cycle: (1) compares accuracy and AUC against the previous model, (2) recalibrates block/boost thresholds relative to base win rate, (3) audits live predictions against actual outcomes, (4) reports shadow P&L stats for blocked trades, and (5) sends a comprehensive Telegram report with all metrics.
Weekly Telegram digest anomaly flags: The weekly performance report includes automated anomaly detection — flags for trade drought (5+ days without a trade), win rate drops (>15% vs prior week), agent accuracy falling below 30%, concentration risk (single instrument >60% of P&L), high ML block rate (>50%), shadow P&L suggesting over-aggressive guards, and significant drawdowns.