# Why does live differ from my backtest?

> Costs, the bid and ask, gaps and your broker.

Source: https://algobarsx.com/docs/why-live-differs/

- **Backtests have no costs.** No spread, commission, fees, swaps or slippage. Profit is the price difference ([E12](https://algobarsx.com/docs/rules-prices-distances-and-size/#E12)).
- **Live trades on the bid and the ask.** A buy fills on the ask, a sell on the bid, and stops and targets trigger on the side that can actually trade ([E3](https://algobarsx.com/docs/rules-fills/#E3), [E5](https://algobarsx.com/docs/rules-fills/#E5)). A backtest has one price.
- **Gaps move fills.** When a bar opens beyond a stop, the fill is the open, not the stop price ([E8](https://algobarsx.com/docs/rules-fills/#E8)).
- **The broker decides live fills.** A live trade exists only once your broker confirms it. Execution speed and liquidity are outside the script.
- **The data may be thinner.** [`data.coverage`](https://algobarsx.com/docs/ref-fn-data/#ref-data-coverage) tells a script how much history it has and whether it is exact.

Past performance does not guarantee future results.
