Universal Quant Tournament MCP
Generates standardized bracket-order JSON webhook payloads for TradingView/Tradovate relays, enabling TradingView-triggered order execution through third-party webhook automation relays such as TradersPost, PickMyTrade, and PineConnector.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Universal Quant Tournament MCP run an 8-strategy tournament on EURUSD and show the winning setup"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Universal Quant Strategy Tournament & Execution Engine (v1.0)
An institutional-grade, top-down quantitative trading engine, out-of-sample walk-forward backtester, Bayesian Monte Carlo risk gate, and multi-broker order router. Designed for seamless integration with REST API pipelines, AI Trading Agents, and Claude Desktop via Model Context Protocol (universal-quant-tournament-mcp) with direct local MetaTrader 5 (MT5), Alpaca, and Tradovate / TradingView execution support.
Broker Execution Tiers & Roadmap
To ensure institutional reliability, broker integrations are categorized by execution verification level:
Tier 1: Live Verified Direct Execution (Production Ready)
MetaTrader 5 (Forex, Metals, Energies & Index CFDs): Direct local Windows terminal execution via the built-in zero-install Python IPC bridge (
sync_or_execute_local_mt5). Features sequential mutex queueing, automatic Market Watch symbol activation, live broker OHLCV bar ingestion, account equity/leverage syncing, pre-flightorder_check()margin/stops validation, and automaticMARKET_DEALvs.PENDING_LIMITorder routing.Alpaca (US Equities, ETFs & Crypto): Direct Paper & Live execution via
alpaca_bracket_orderpayloads[cite: 1] paired with the companion@ideadesignmedia/alpaca-mcpserver or Alpaca REST API.
Tier 2: Universal Webhook JSON Schema (Beta)
TradingView / Tradovate Webhook Relay (
tradovate_tradingview_webhook): Generates standardized bracket order JSON payloads[cite: 1] compatible with third-party webhook automation relays (such as TradersPost, PickMyTrade, and PineConnector). Note: When routing CME Futures (MNQ,MES,ES,NQ), append your active front-month contract expiry code (e.g.,MNQZ6for Dec 2026) as required by your relay provider.
v1.1 Roadmap (In Development)
TradeLocker Native REST Bridge: Direct JWT authentication and automatic
tradableInstrumentIdlookup for prop-firm accounts.Direct Tradovate OAuth2 Bridge: Native REST order routing without third-party webhook relays.
Related MCP server: PineScript MCP Server
Core Institutional Architecture (5-Stage Pipeline)
Unlike basic indicator scripts that generate unvalidated signals, this engine enforces a strict 5-stage institutional desk workflow before approving any trade:
Live ForexFactory Macro Calendar Filter: Automatically fetches and caches the official weekly economic calendar feed (
forexfactory.com). Detects High-Impact (RED_FOLDER_HIGH_IMPACT) and Medium-Impact (ORANGE_FOLDER_MEDIUM_IMPACT) events affecting the target asset's currency/macro exposure (USD,EUR,GBP,JPY,AUD,NZD,CAD,CHF,XAU,XAG) within a 24-hour window and automatically blocks live signal activation if a Red-Folder release is within 60 minutes.Higher-Timeframe (HTF) Structure & Regime Classifier: Evaluates 200-SMA, 400-SMA, 50-EMA, ATR separation, and Bollinger Band width to classify the market into
STRONG_BULLISH_TREND_REGIME,STRONG_BEARISH_TREND_REGIME,DIRECTIONAL_EXPANSION_REGIME,VOLATILITY_SQUEEZE_COILING_REGIME, orRANGING_MEAN_REVERTING_REGIME, dynamically weighting strategy families that fit the active regime.Session Killzone & Price-Action Confirmation Guardrails: Filters historical backtests and live signals by configurable UTC liquidity windows (
london_ny,london_only,ny_only,london_ny_overlap,us_equity_regular,24_7, orcustom). Enforces strict entry-bar candle confirmation (BULLISH/BEARISH_ENGULFING_CLOSE,REJECTION_PINBAR, orDISPLACEMENT_CLOSE) and an Anti-Exhaustion RSI Guardrail that prevents momentum/breakout strategies from buying overbought (RSI > 68) or shorting oversold (RSI < 32) extremes.Strict Out-of-Sample (OOS) Bounded Walk-Forward Tournament: Simultaneously backtests 8 quantitative strategies across a two-stage split (65% In-Sample / 35% Out-of-Sample) with spread deduction (
0.04x ATR) and Bayesian shrinkage. To prevent curve-fitting and mask out-of-sample decay,win_rate_prioris strictly capped at the lower bound of the In-Sample, Out-of-Sample, and Full-Sample win rates.1,000-Path Bayesian Monte Carlo & Auto-Routed Bracket Execution: Stress-tests the tournament winner across 1,000 paths (30 trades/path) incorporating Gaussian win-rate dispersion ($\sigma = 6.5%$), serial loss correlation ($-1.5%$), spread slippage, and tail stop-gap shocks. Outputs Half-Kelly and Quarter-Kelly sizing benchmarks and builds ready-to-fire bracket payloads (
MARKET_DEALwhen a live trigger candle is active, orPENDING_LIMITpullback orders when awaiting confirmation).
The 8 Competing Quantitative Strategies
Every tournament call ranks all 8 strategies by composite expectancy ($R$), HTF alignment, regime compatibility, and sample reliability:
Strategy ID | Strategy Name | Family | Stop / Target (ATR) | Core Logic |
| Trend Pullback Champion |
|
| 200-SMA trend alignment + RSI pullback ( |
| Heikin-Ashi Momentum + Fast MACD |
|
| Consecutive Heikin-Ashi trend bodies + Fast MACD ( |
| Institutional Bollinger + RSI Extreme |
|
|
|
| Session Anchor Elasticity Reversion |
|
|
|
| ICT Optimal Trade Entry (OTE) |
|
| 50-bar swing range |
| Volatility Squeeze & 20-Bar Breakout |
|
| 20-bar channel breakout with ATR expansion ratio and RSI anti-exhaustion filter. |
| EMA Ribbon Trend Following |
|
| Stacked EMA ribbon ( |
| Standard MACD + Golden Pocket Fib |
|
| Expanding Standard MACD ( |
Supported Asset Classes & Contract Sizing Intelligence
US Equities & ETFs (
EQUITY): Any US stock or ETF (NVDA,AAPL,SPY,QQQ). Sizes integer shares for Alpaca (1 shareincrements) and Equity CFD lots for MT5 (1.00 lot = 100 shares).28 Spot Forex Pairs (
FOREX): All major and cross pairs (EUR/USD,GBP/JPY,USD/JPY,AUD/CAD, etc.). Automatically calculates100,000base-unit standard lots and convertsJPYquote pairs orUSDbase pairs into exact USD risk using spot cross-rates.Precious Metals & Energy (
METALS_COMMODITIES): Auto-detects Gold (XAU/USD,XAUUSD,GOLD,GC), Silver (XAG/USD,SILVER,SI), and Oil (WTI,USOIL,UKOIL,CL). Applies institutional MT5 contract specs (100 troy oz/lotfor Gold,5,000 troy oz/lotfor Silver,1,000 barrels/lotfor Crude Oil).CME Futures & Index CFDs (
FUTURES): SupportsMNQ,NQ,MES,ES,MYM,YM,NAS100,US500,US30with configurablecontract_multiplierpoint values (e.g.,$2/ptforMNQ,$20/ptforNQ) and automatic Micro E-mini scaling for accounts under$25,000.Cryptocurrencies (
CRYPTO): 24/7 liquidity mode forBTC/USD,ETH/USD,SOL/USD,XRP/USD,DOGE/USD,ADA/USD,AVAX/USDwith fractional0.0001unit precision.
API Endpoints
1. POST /api/v1/quant/multi-strategy-tournament
Runs the 5-stage top-down analysis, ForexFactory calendar check, regime classification, and 8-strategy Out-of-Sample walk-forward tournament.
Example Request Body:
{
"symbol": "XAU/USD",
"timeframe": "15Min",
"lookback_bars": 1000,
"strategy_filter": "all",
"session_filter": "auto",
"require_candle_confirmation": true
}Key Response Fields:
top_down_market_context: HTF structure bias, 400-SMA / 200-SMA slope, detected market regime, active session window status, RSI exhaustion state, and live entry-bar candle confirmation telemetry.forex_factory_macro_calendar: Monitored currencies,high_impact_collision_within_60mboolean, imminent Red-Folder alerts, and upcoming 24h scheduled macro releases.champion_strategy: Top-ranked strategy withexecution_readiness_status(READY_FOR_IMMEDIATE_MARKET_EXECUTIONorPENDING_PULLBACK_LIMIT_ORDER_RECOMMENDED),recommended_order_execution_mode(MARKET_DEALvsPENDING_LIMIT),win_rate_prior(strictly OOS-bounded),zero_edge_breakeven_win_rate,entry_price(auto-routed to pullback limit if unconfirmed),stop_loss, andtake_profit.leaderboard: Full ranked array of all 8 strategies with In-Sample and Out-of-Sample win/loss records.
2. POST /api/v1/quant/monte-carlo-stress-test
Stress-tests a trade setup across 1,000 simulated paths with parameter dispersion, serial correlation, slippage, and tail gap shocks.
Example Request Body:
{
"entry_price": 2685.50,
"stop_loss": 2678.00,
"take_profit": 2700.50,
"win_rate": 0.545,
"paths": 1000,
"trades_per_path": 30,
"risk_per_trade_pct": 0.015,
"slippage_bps": 5,
"min_probability_of_profit_pct": 65.0
}Key Response Fields:
probability_of_profit_pct,median_30_trade_return_pct,var_95_worst_case_return_pct,max_drawdown_95th_pct,risk_of_30pct_ruin_pct.kelly_criterion_telemetry:quarter_kelly_conservative_risk_pct,half_kelly_optimal_risk_pct, and sizing assessment.institutional_gate_passed(true/false) &verdict(APPROVED_FOR_EXECUTIONor rejection reason).
3. POST /api/v1/quant/universal-order-router
Calculates exact position sizing constrained by both your dollar risk budget and 95% of leveraged buying power, outputting broker-ready payloads.
Example Request Body:
{
"symbol": "XAU/USD",
"asset_class": "FOREX",
"broker_format": "mt5",
"bias": "LONG",
"entry_price": 2685.50,
"stop_loss": 2678.00,
"take_profit": 2700.50,
"account_equity_usd": 10000,
"risk_per_trade_pct": 0.015,
"account_leverage": 100,
"usd_jpy_rate": 154.5,
"execution_mode": "AUTO"
}Key Response Fields:
levels:entry_price,pending_pullback_limit_price,stop_loss,take_profit,stop_distance, andstop_distance_pips.risk_telemetry: Exact dollar risk, margin required, notional exposure,recommended_mt5_lots,recommended_equity_shares, orrecommended_futures_contracts.broker_execution_payloads:mt5_mql5_order_send: Includes bothTRADE_ACTION_DEAL(ORDER_FILLING_IOC) andTRADE_ACTION_PENDING(ORDER_FILLING_RETURN) with 31-character safeUQMCPcomments.alpaca_bracket_order: Ready for Alpaca Paper/Live REST API or MCP execution (EQUITY&CRYPTO).tradovate_tradingview_webhook: JSON webhook payload for futures/CFD automation.
Claude Desktop MCP & Local MT5 Bridge Setup
Use the companion MCP server (universal-quant-tournament-mcp) to connect Claude Desktop directly to this API, Alpaca Paper Trading, and your local Windows MetaTrader 5 terminal (with pre-flight order_check() validation and live broker bar fetching).
{
"mcpServers": {
"universal-quant-tournament": {
"command": "npx",
"args": ["-y", "universal-quant-tournament-mcp"],
"env": {
"RAPIDAPI_KEY": "YOUR_RAPIDAPI_KEY",
"RAPIDAPI_HOST": "universal-quant-strategy-tournament.p.rapidapi.com",
"ALPACA_KEY_ID": "PK_YOUR_ALPACA_PAPER_KEY_ID",
"ALPACA_SECRET_KEY": "YOUR_ALPACA_PAPER_SECRET_KEY",
"ALPACA_PAPER": "true"
}
}
}
}⚠️ Legal Disclaimer & Risk Disclosure
For Informational & Educational Purposes Only — Not Financial Advice:
The data, technical indicators, strategy tournament rankings, Monte Carlo simulations, and broker order payloads generated by universal-quant-tournament-mcp and its associated APIs are provided strictly for informational, educational, and quantitative research purposes. Nothing contained herein constitutes financial, investment, legal, or tax advice, nor does it constitute a solicitation, recommendation, endorsement, or offer to buy or sell any securities, foreign exchange (Forex), futures, options, cryptocurrencies, or other financial instruments.
Hypothetical & Simulated Performance Disclaimer:
Monte Carlo stress tests and strategy tournament expectancy scores are mathematical simulations based on historical or synthetic parameters and do not represent actual trading. Hypothetical or simulated performance results have inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
Assumption of Risk & Autonomous Execution Liability:
Trading financial markets involves a high degree of risk, including the potential loss of your entire invested capital. By connecting this software or API to any AI agent, LLM, webhook, or brokerage execution environment (including paper or live accounts on Alpaca, MetaTrader 5, Tradovate, or any other platform), you acknowledge that you are solely responsible for verifying all order parameters, position sizes, and risk limits prior to execution. The authors, contributors, and API providers assume zero liability for any financial losses, execution slippage, API downtime, software bugs, or autonomous agent errors incurred through the use of this software. Use strictly at your own discretion and risk.
Available Tools
4 toolsbuild_universal_bracket_orderB
Generates risk-sized, leverage-aware bracket order payloads for Alpaca (Equities/Crypto), MetaTrader 5 (Forex/CFD/Metals with 100 oz Gold lot sizing and USD/JPY cross-rate conversion), and Tradovate/TradingView Webhooks (Futures).
Inputs: bias (required), symbol (required), stop_loss (required), entry_price (required), +7 more.
run_monte_carlo_stress_testB
Runs a 1,000-path Bayesian Out-of-Sample Monte Carlo simulation and Half-Kelly risk assessment on a strategy's entry, stop-loss, take-profit, and validated win rate.
Inputs: stop_loss (required), entry_price (required), take_profit (required), slippage_bps, +4 more.
run_multi_strategy_tournamentC
Performs a top-down institutional market evaluation: (1) Pulls live ForexFactory high/medium impact macro events (forex_factory_macro_calendar) and checks forexfactory.com/calendar for scheduled news risk, (2) Classifies Higher-Timeframe (HTF) structure and market regime, (3) Filters historical and live signals by user-definable session liquidity hours using bar timestamps, (4) Requires price-action candle confirmation (Engulfing, Rejection Pinbar, or Displacement close) on the entry bar, and (5) Evaluates 8 quantitative strategies via a two-stage Out-of-Sample walk-forward backtest.
Inputs: symbol, timeframe, custom_bars, lookback_bars, +6 more.
sync_or_execute_local_mt5A
Connects directly to the user's open Windows MetaTrader 5 desktop terminal to either (1) pull live broker OHLCV candles and account equity/leverage, or (2) execute an approved mt5_mql5_order_send bracket order after explicit user confirmation.
Inputs: action (required), symbol, timeframe, lookback_bars, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a distinct stage: tournament evaluation, Monte Carlo stress testing, bracket payload construction, and MT5 sync/execution. The only potential overlap is between building an order and executing it, but the descriptions clarify the boundary; the tournament tool is broad but still a single evaluation operation.
All names are snake_case and verb-led, mostly following a predictable verb_noun pattern. The compound verb 'sync_or_execute' and very long descriptive names are minor deviations, but the convention remains readable and consistent.
Four tools is compact and each maps to a real workflow stage. It is slightly thin for a 'universal' quant server because several capabilities are bundled into the tournament tool, but the count is reasonable and not excessive.
The core workflow of evaluate, stress-test, construct bracket order, and execute is covered, including multi-broker payload generation and local MT5 access. Gaps remain around order lifecycle management such as modify/cancel/close/status and strategy/result management, but core workflows are present.
Maintenance
Related MCP Connectors
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Guardrails for trading agents. Built-in risk management, 100+ tools for strategy R&D, 12+ venues.
AI agents backtest, paper trade and live trade via your broker. Free to connect; OAuth.
AI agents build, backtest and run ML prediction models: market data, cloud GPUs, live trading.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceFull-lifecycle algorithmic trading MCP server. AI strategy generation from plain English, backtesting, live bot deployment to 10+ brokers, portfolio monitoring, and prediction markets. Stocks, options, crypto, futures. 32 tools. Free tier.-
- FlicenseNot gradedqualityDmaintenanceEnables creation, optimization, and management of PineScript trading strategies with Claude Desktop integration for AI-assisted development.106-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude to run backtests, fetch market data, list strategies, and analyze trading algorithms via natural language.1,141GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables quant research, strategy generation, backtesting, and paper trading from natural language prompts, integrating with AI agents via an MCP server.24-