Quickstart
Add Bagtester to your AI coding agent and run your first backtest in under five minutes.
1. Create an account
Sign up at bagtester.com/sign-up. You'll get 500 credits / month on the free tier — enough for ~10 single 1-year minute-mode backtests on BTC, ETH, or SOL, or many shorter ones for fast iteration.
2. Generate an API key
From your dashboard, generate a new key. It looks like bag_xxxxxxxxxxxxxxxx. Copy it once — we don't show it again.
3. Add the MCP server to your agent
Claude Code
bash
claude mcp add --transport http bagtester https://bagtester.com/api/mcp \ --header "Authorization: Bearer bag_yourkeyhere"
Codex
json
{
"mcp_servers": {
"bagtester": {
"url": "https://bagtester.com/api/mcp",
"transport": "http",
"headers": { "Authorization": "Bearer bag_yourkeyhere" }
}
}
}Cursor
Settings → MCP Servers → Add. Paste the URL, set Authorization: Bearer bag_… as a header.
4. Ask your agent to backtest something
Try this prompt:
text
> Backtest a 20/50 SMA crossover on BTCUSDT for 2024-Q1. > Use the bagtester MCP server.
The agent will write a Python strategy, call submit_strategy, and return a structured result — equity curve, Sharpe ratio, max drawdown, trade count. All in seconds.
5. Iterate
Once you have a strategy worth iterating on:
- Hybrid mode — re-run with
mode: "hybrid"for adverse-fill realism. - optimize_strategy — sweep parameters to find the best Sharpe (Quant tier).
- walk_forward — verify the strategy generalizes out-of-sample (Quant tier).
Next steps
- Read the MCP API reference for every tool's full signature.
- Browse strategy templates for SMA / RSI / momentum patterns.
- Check available data to see what symbols and timeframes you can backtest.