Backtesting
Single-symbol backtest
Run an asynchronous backtest for one ticker and strategy.
What it is
Single-symbol backtests let you submit one strategy for one ticker, receive abacktest_id immediately, and fetch the results asynchronously once the run completes.
When to use it
- Validating a new strategy idea without portfolio complexity.
- Benchmarking entry and exit logic on a single, liquid instrument.
- Creating a fast automation loop from signal idea to historical result.
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': 'AAPL SMA crossover',
'symbols': ['AAPL'],
'start_date': '2024-01-01',
'end_date': '2025-01-01',
'initial_capital': 10000,
'strategy': {
'entry': {
'condition': 'SMA_20 > SMA_50',
'signal_names': ['SMA_20', 'SMA_50'],
},
'exit': {
'condition': 'SMA_20 < SMA_50',
},
'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": "AAPL SMA crossover",
"symbols": ["AAPL"],
"start_date": "2024-01-01",
"end_date": "2025-01-01",
"initial_capital": 10000,
"entry_condition": "SMA_20 > SMA_50",
"entry_signal_names": ["SMA_20", "SMA_50"],
"exit_condition": "SMA_20 < SMA_50"
}
}Agent prompt that triggers it
Run a single-symbol SMA crossover backtest for AAPL over 2024 and wait for the finished summary.