Backtest an agent
Overview
Before running an agent live, it's recommended to test its past performance on historical data. This is called a backtest.
The goal is to understand how the agent would have reacted in different market conditions — bullish phases, bearish phases, periods of high volatility, drawdowns, etc.
Backtests are relevant for trading bots and investing agents with deterministic rules. For an AI trader, backtesting is less representative since the AI exploits the present context (news, positioning) which can't be faithfully replayed in the past.
Launching a backtest
From an agent's page, click Create a backtest. A dialog guides you through a few steps: Parameters → Assets → Fees → Review (only the steps relevant to your agent are shown).
1. Parameters
Backtest period
Define a start date and end date for your backtest. Only this period will be used to simulate past operations and analyze the agent's performance.
Presets are available: last month, last 6 months, last year, last 5 years.
We have over 20 years of history for most assets.
If the chosen start date predates our price history, the backtest will automatically start at the earliest date available in our database.
Our data is updated daily to integrate the latest price changes.
Available history depth depends on your plan: 5 years (Free) and 20 years (Plus, Pro, Max). See Pricing.
Starting capital
Define a starting capital for your backtest.
For a trading bot: starting capital is required, as it evolves dynamically based on gains and losses generated by each trade.
For an investing agent: capital can be defined directly in the description (DCA, conditional purchases, etc.). If an initial amount must be invested in one go, it should also be specified in the description.
While the starting capital doesn't affect the trades historically executed, choosing a realistic value helps you better project the evolution.
2. Assets
If needed, pick the target symbol for each asset used by the agent, so the simulation runs on exactly the instruments you have in mind.
3. Fees
For each asset referenced in the agent, you can fine-tune the trading conditions applied during the simulation:
Commission — as a percentage, a flat fee, or per contract.
Spread — as a percentage or a flat amount.
Swap fees — overnight financing costs for held positions.
Leverage — the leverage applied to the asset.
Default values are pre-filled per asset. Tuning fees to match your broker makes the backtest more realistic, especially for high-frequency strategies where costs add up.
4. Review
Review the period, starting capital and per-asset configuration, then run the backtest. Results appear automatically as soon as the run completes.
Backtest results
Once the backtest is complete, you can access several tabs to analyze performance:
Metrics — dozens of detailed indicators (return, CAGR, max drawdown, Sharpe, Sortino, win rate, profit factor, expectancy, etc.) plus the Obside Score.
Performance — capital curve over the period, with monthly and yearly performance and drawdown views.
Chart — visualization of all entry and exit points on the price chart, with the reason for each trade.
Trades — full list of executed operations, exportable.
Simulation — a "simulate my investment" calculator: project a starting capital and monthly contributions on the backtest's performance to see what it would have meant for you.
The Obside Score estimates the quality of a backtest by combining performance, risk and statistical reliability. See Obside Score.
Iterating on the agent
If the backtest results aren't satisfactory, you can continue the conversation in the chat linked to the agent to adjust its description, then run a new backtest with the same parameters or different ones.
Mis à jour