Comparison
Bagtester vs QuantConnect
Both run Python backtests on real market data. QuantConnect is a browser-first quant research platform — Lean engine, web IDE, decade-deep multi-asset coverage, live trading on paid tiers. Bagtester is an MCP server built for AI coding agents — your agent writes a Python strategy, calls our MCP, gets structured results back, no IDE switch required.
Pick QuantConnect if you want an all-in-one browser-based quant research stack with live deployment. Pick Bagtester if you want the agent → backtest → result loop to run inside your existing editor.
Side by side
| Topic | Bagtester | QuantConnect |
|---|---|---|
| Primary surface | MCP server. Your AI agent (Claude Code, Codex, Cursor) submits Python strategies. Optional web dashboard for review and sharing. | Web IDE in the browser. Strategies are written and run inside QuantConnect's interface. |
| Where you write code | Anywhere — your local editor, IDE, or agent's editor. Plain Python on disk. | QuantConnect Cloud editor or the Lean CLI for local-to-cloud sync. |
| Framework dependency | Subclass `bagtester.Strategy`, implement `on_bar(self, ctx, bar)`. Stdlib + numpy / pandas / polars / scipy / scikit-learn / statsmodels / ta-lib / pandas-ta. No framework lock-in. | Subclass `QCAlgorithm`, implement `Initialize` / `OnData`. Tightly coupled to QuantConnect's framework and naming conventions. |
| Submission flow | Ask your agent: 'backtest this strategy on BTCUSDT for 2024'. Agent calls `submit_strategy` over MCP. Result back in ~7-15s for a 1-year minute-mode crypto run. | Open IDE, edit code, click backtest, wait for cloud queue, click result. |
| Output shape | Schema v2.0 JSON: 107 metrics across 8 categories + 12 quality flags + 58 scoring features. Sparkline previews for terminals, PNG visuals for chat UIs, share URLs with OG cards. | Tearsheet with ~50 metrics + chart pack. Read in the browser; exports require user action. |
| Asset coverage | Crypto top-50 (1m + tick for BTC/ETH/SOL), 16 FX majors with tick from 2003, ~200 US stocks 1m + EOD, ~50 ETFs, fundamentals for DOW 30, perp funding rates. | Broad: US equities, options, futures, crypto, FX, CFDs. Real exchange data on higher tiers. |
| Execution realism | Three modes — minute (1× cost), hybrid (3× cost, adverse-fill within bar), tick (10× cost, full event-driven). FX hybrid models bid/ask spread per bar. | Backtesting at chosen resolution. Tick-level on supported brokerages. Slippage / fee models configurable. |
| Subscription management | From your agent. The `manage_subscription` MCP tool returns plan, credits, and a Stripe customer-portal URL for upgrade / downgrade / cancel. | Web dashboard only. |
| Pricing | $0 Free (500 credits/mo), $19 Trader (30k credits), $39 Quant (300k credits + tick + walk-forward). Top-ups from $5 to $300. | Free researcher tier with limits, paid tiers starting $20-$50/mo for backtesting compute, $100+/mo for live deployment + data add-ons. |
| Live trading | Not yet. Bagtester is backtesting-only by design. Live execution will route through brokerage APIs in a later phase. | Yes — live deployment to supported brokerages on paid tiers. |
| Where it shines | Iterative backtests during an AI-agent coding session. Reproducible, structured outputs for agent reasoning. | Comprehensive in-browser quant research with deep historical coverage and live deployment in one stack. |
When to pick Bagtester
- →You already work with an AI coding agent and want backtesting inside that workflow.
- →You want plain Python with no framework lock-in.
- →You want structured JSON output your agent can act on without parsing prose.
- →Your strategies cover crypto, FX majors, US large-caps, or ETFs — and you care about realistic per-bar execution.
- →You want subscription management from inside the agent (cancel, upgrade, view invoices).
When to pick QuantConnect
- →You want a single platform that runs backtests AND deploys live to brokerages.
- →You need deep options, futures, or institutional equity asset coverage.
- →You prefer a browser-based IDE and collaborative research environment.
- →You're building strategies that need scheduled events, consolidators, and the broader Lean primitives.
Frequently asked
Is Bagtester a fork of Lean or QuantConnect?+
No. Bagtester runs a custom Python backtest engine (subclass `bagtester.Strategy` with `on_bar`) on real market data in a sandboxed Cloud Run worker. It shares no code with Lean or QuantConnect — that lets us keep the agent-facing API surface deliberately minimal.
Can I migrate a QuantConnect algorithm to Bagtester?+
Most strategy logic ports cleanly. You replace `QCAlgorithm` with `bagtester.Strategy`, rename `OnData` to `on_bar`, and swap order calls (`self.SetHoldings` becomes `ctx.buy/sell/close`). The bigger refactor is around scheduled events and consolidators, which Bagtester doesn't yet expose 1:1.
When should I pick QuantConnect over Bagtester?+
If your priority is browser-based collaborative research, deep options / futures coverage, or going from backtest to live trading in one platform. Bagtester is focused on the agent-driven backtesting loop — we don't compete on live deployment or institutional asset breadth.
Why MCP instead of a REST API?+
AI coding agents speak MCP natively. A REST endpoint requires the agent to be configured with a custom tool wrapper; MCP is the protocol the agent already knows how to discover and authenticate against. We can add REST later if there's demand outside the agent context.
How does Bagtester's data quality compare?+
On crypto and FX, we use the same tick sources QuantConnect's community-tier data is built on, and we document per-bar caveats (e.g. US stocks intraday is single-venue IEX, ~2-3% of consolidated tape volume). For execution-sensitive HFT on US equities, QuantConnect's higher tiers with consolidated-tape data will be more accurate; for crypto and FX, the gap is small.
Try the agent → backtest loop
500 credits/month on the free tier. Add the MCP server to your agent, ask it to backtest a strategy, see whether the workflow fits your team.