Skip to main content
Glama

finzdata-mcp

Run backtest

run_backtest
Read-only

Runs a deterministic backtest from a JSON spec (universe, start, end, signal, rebalance, top_n, costs_bps, side='long'|'long_short', blind=true to hide tickers). universe: a list of symbols, or 'top500'|'top1000'|'top3000'|'all' for the liquid US market (each month the N most-traded names priced >= min_price, default $5, by 63-day dollar volume; 'all' = liquid_top names, default 1000, max 3000; delisted names included while they traded; membership is set on each month's last trading day and used from the next). rebalance: D|W|M|Q (or daily/weekly/monthly/quarterly). signal.type: momentum (lookback, skip days), ma_cross, factor, or expr with signal.expr a formula over close prices, e.g. 'rank(ret(252)) - rank(vol(60))' (functions: ret, logret, sma, ema, vol, rsi, high, low, dist_high, lag, rank, zscore, demean, abs, log, sign, clip, min, max, where). Every result includes 'overfitting': trials counted per API key and the deflated Sharpe ratio. Prices are fetched point-in-time with a 400-trading-day lookback buffer and clipped to as_of, so results have no look-ahead. Identical specs on the same snapshot are cached and free. Returns stats, benchmark stats, equity curve, warnings, snapshot id and a disclaimer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesBacktest spec.
as_ofNoPoint-in-time cutoff (YYYY-MM-DD). Nothing dated after this is returned, preventing look-ahead bias. Defaults to today (UTC).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources