Valuein
Discovery

Run Bounded Factor Backtest

run_backtest
Pro and above

A SMALL, BOUNDED, in-Worker sanity-check backtest — NOT a full-universe backtesting engine. Answers a quick question like 'does this factor actually work on these 5 names over the last year' inline, mid-conversation, without leaving MCP. Composes two existing tools (`get_pit_u...

Example Call

example_call.pypython
# Using the Valuein MCP server from Python (via MCP SDK)# Or call directly from Claude / Cursor after setup result = await client.call_tool(    "run_backtest",    arguments={    "tickers": [],    "rebalance_dates": []})print(result)

Direct tool call:run_backtest(...)

Inputs

ParameterTypeRequiredDescription
tickersarray
required
1-10 stock ticker symbols, e.g. ["AAPL","MSFT"].
rebalance_datesarray
required
1-12 historical dates (YYYY-MM-DD) to snapshot valuation multiples on. Order does not matter — the tool sorts them chronologically. Forward return is computed from each date to the NEXT one in the sorted list.
factorsarrayoptionalWhich of get_pit_valuation_ratios's own output fields to include as factor_values. One or more of: pe_ratio, ps_ratio, pb_ratio, ev_ebitda, ev_revenue, fcf_yield_pct, gross_margin_pct, operating_margin_pct, net_margin_pct. Omit to include all of them.

Output Fields

methodgrid_cellscells_computedpit_safecappedsource_tools_usedcaveatstickersrebalance_datesfactorsdroppedcellssummarystreamsnext_stepnote

Example Response

Illustrative
response.jsonjson
{  "method": null,  "grid_cells": null,  "cells_computed": null,  "pit_safe": null,  "capped": null,  "source_tools_used": null,  "caveats": null,  "tickers": null}

Shape only — field names match the live schema; values are placeholders, not real filings. See MCP server for the structured response shape.

Notes

Available from the Pro plan and above.

Try this tool

Get tokenAll tools
CategoryDiscovery
PIT-safeNo
Min planPro
Inputs3 (2 required)

Plan Access

Sample (guest)
Not included
Benchmark (token)
Not included
Pro
Available
Institutional
Available

Index names are trademarks of their owners; Valuein is not affiliated with or endorsed by any index provider.