For agents. Use this when your user says "backtest this", "would this have worked", or "test this strategy on X".
Without a key: a template in one call
Families: momentum, trend_following, mean_reversion, breakout. You get return, CAGR, Sharpe, max drawdown, win rate, trade count and the last trades. Good for a first answer; to test the user's actual rules, connect and use a project.
With a key: the user's own rules
list_marketsto resolve the asset ("nvidia" →nvda).create_projectwith a precise thesis and the closest family; the platform writes runnable Python.read_filesand adaptstrategy.py/config.jsonto the user's rules withwrite_files(complete file contents). Or askask_project_copilotto make the change.run_backtest. Fills are at the next bar's open with commission and slippage; unchanged code re-runs free.get_backtestfor the trade ledger, exit reasons and drawdown periods.
How to report it
- Lead with trade count. Fewer than 30 trades means the numbers are anecdotes.
- Give CAGR and max drawdown together; compare with buy-and-hold (
benchmarkReturn). - Say the window and bar size. Say it is simulated.
- Point at the weakest part: "most of the return came from two trades in 2024".
Tell your user
I backtested it on 3 years of daily data with realistic fills and costs: [CAGR], max drawdown [DD], [N] trades. [One sentence on what drives the result.] This is a simulation, not a promise; want me to test a variation?
Related: Read a backtest like a quant [blocked], Check for overfitting [blocked].