Backtesting a Strategy
Would you drive a car without checking the brakes?
Backtesting lets you run your trading strategy against historical market data before you commit real capital. The results appear as a node on the canvas so you can see how your automated trading strategy would have performed historically.
How it works
When you run a backtest, the Strategy Builder:
- Takes the current strategy graph from the canvas
- Fetches historical price and indicator data for the time range
- Replays the strategy through that data, simulating fills at historical prices
- Shows the results in a Backtest Result node
The backtest uses the same execution logic as live strategies. The results reflect how the strategy would have behaved historically.
Backtesting is not a guarantee of future results. It should be used as a tool to understand how your strategy might perform under different conditions, not as a guarantee of future performance.
Running a backtest
- Build or load your strategy on the canvas.
- Click Run Backtest in the floating toolbar.
- The builder prepares the historical data range and runs the simulation.
- A Backtest Result node appears on the canvas with the outcome.
If the strategy graph has validation errors, the backtest will not run. Fix any flagged issues first.
Reading the results
The Backtest Result node shows several metrics:
| Metric | What it means |
|---|---|
| Return | Total percentage gain or loss across all simulated trades |
| Sharpe | Risk-adjusted return. Above 1 is generally considered good |
| Drawdown | Largest peak-to-trough decline during the backtest period |
| Win Rate | Percentage of trades that were profitable |
Below the metrics, the summary section shows:
- Start / End: Starting and ending portfolio value in USD
- Annualized: Return projected to a full year
- Profit Factor: Gross profit divided by gross loss. Above 1 means the strategy made more than it lost
- Fills: A list of every simulated trade with side (buy/sell), size, price, and timestamp
Partial results
If some historical data is missing or the output is truncated to fit display limits, the result node shows a Partial badge with a warning message. The metrics are still useful, but the fill list may be incomplete.
Limitations
Backtests simulate fills at historical prices. They do not account for slippage, latency, or market impact beyond what is configured in your strategy.
Historical indicator values are computed from historical data, not live feeds. This is usually accurate but can differ slightly from real-time computation during fast markets.
The backtest runs against the current canvas state. If you modify the strategy after running a backtest, the result node reflects the old version until you run it again.
Tips
Run a backtest before deploying any new strategy. It catches logical errors like impossible conditions or misconfigured cycles. Make sure you have configured stop loss and take profit levels before backtesting so the simulation includes realistic risk management.
Compare backtest results across different time ranges to see how the strategy behaves in different market regimes.
Delete old backtest result nodes to keep the canvas clean. Click the X on the node header.
Next Steps
Once you’re happy with the backtest performance of your trading strategy, you can deploy it to live markets. Read Deploy a Strategy to learn how.