⚠ MVP PreviewReport a Bug

Backtesting

Multi-symbol portfolio backtest

Evaluate an equal- or custom-weight portfolio strategy.

What it is

Multi-symbol backtests apply one strategy across a symbol basket and return both portfolio aggregates and per-symbol result slices. The API supports equal or custom weighting.

When to use it

  • Comparing whether a rule survives beyond a single stock.
  • Testing sector baskets or hand-picked portfolios under the same logic.
  • Studying how weighting decisions affect drawdown and total return.

REST example

python
import os
import requests

response = requests.post(
  'https://api.financedata.com/v1/backtests/run',
  headers={
      'Content-Type': 'application/json',
      'X-API-Key': os.environ['FDA_KEY'],
  },
  json={
      'name': 'Mega-cap RSI basket',
      'symbols': ['AAPL', 'MSFT', 'GOOGL'],
      'start_date': '2024-01-01',
      'end_date': '2025-01-01',
      'initial_capital': 25000,
      'weighting': 'equal',
      'strategy': {
          'entry': {
              'condition': 'RSI_14 < 30',
              'signal_names': ['RSI_14'],
          },
          'exit': {
              'condition': 'RSI_14 > 55',
          },
          'position_size': 1.0,
          'commission': 0.001,
      },
  },
  timeout=30,
)
response.raise_for_status()
print(response.json())

MCP example

Tool call body

{
"name": "submit_backtest",
"arguments": {
  "name": "Mega-cap RSI basket",
  "symbols": ["AAPL", "MSFT", "GOOGL"],
  "start_date": "2024-01-01",
  "end_date": "2025-01-01",
  "initial_capital": 25000,
  "entry_condition": "RSI_14 < 30",
  "entry_signal_names": ["RSI_14"],
  "exit_condition": "RSI_14 > 55",
  "weighting": "equal"
}
}

Agent prompt that triggers it

Submit an equal-weight three-stock RSI backtest and wait until the portfolio summary is ready.