# Backtest, forward test and paper

> How a backtest, a forward test and a paper deployment differ, what the simulation leaves out, and the fill, margin and benchmark rules every result rests on.

Source: https://orbitalaip.com/docs/backtesting/backtest-vs-forward-test-vs-paper

> [!IMPORTANT] Disclaimer
> Backtest results are hypothetical and do not predict future performance. Nothing here is investment advice: Orbital computes the rules you supplied and recommends nothing. Orbital is not a registered investment adviser or broker-dealer. Costs are as modelled by the chosen cost profile and may differ from live trading.

## Why the three differ

A [backtest](https://orbitalaip.com/docs/glossary#backtest) replays a strategy over settled history you chose with its rules in mind, in a simulated account. A [forward test](https://orbitalaip.com/docs/glossary#forward-test) runs the same frozen version through each session that settles after you start it: data the rules had never seen. [Paper trading](https://orbitalaip.com/docs/glossary#paper-trading) is a [deployment](https://orbitalaip.com/docs/glossary#deployment) through the Trade app, whose orders Alpaca's paper simulator fills. It tests execution as well as the rules.

None of the three risks money. A deployment to a live account is refused.

## What is not modelled

A backtest and a forward test share one simulation. It reads price bars, not quotes, and charges three costs: the [commission](https://orbitalaip.com/docs/glossary#commission) its [cost profile](https://orbitalaip.com/docs/glossary#cost-profile) names, the run's [slippage](https://orbitalaip.com/docs/glossary#slippage), and a borrow fee on shorts when **Margin account** is on. **Run properties**, on the **Report**, states them under **Costs modelled**. The simulation leaves out:

- Bid-ask spread. No spread is ever crossed. The slippage figure is a stand-in you chose, not a measurement.

- Market impact. A fill never moves the price, whatever its size. Measured one-way impact runs 8 to 13 bps, often more than the whole slippage allowance.

- Queue position. A limit filled when the bar touches your price assumes nobody was ahead of you. The recommended rule waits for the bar to trade through it.

- Partial fills. Every fill is whole: an order the account cannot cover is rejected, never trimmed. Only **Limit entry allocations**, when on, reduces an entry's share count at the fill.

- Regulatory fees. SEC Section 31 and the FINRA TAF on a sale, roughly 0.2 bps of the proceeds, are charged under no profile.

- Extended hours. Only regular hours, 09:30 to 16:00 ET, are simulated.

Alpaca charges no commission on US equities, and its paper account charges no borrow fee, so a short strategy scores worse in a backtest than on paper. Alpaca paper also pays dividends on the pay date, while the backtest books them on the ex-date. **Run properties** lists both under **Where this differs from paper trading**.

## Side by side

| Feature | Backtest | Forward test | Paper |
| --- | --- | --- | --- |
| Data | Settled sessions: daily bars from 2016, minute bars from 2023-09-05 | New sessions, each added after it settles | Orbital's live minute bars, or the previous session's final prices for a daily strategy |
| Fills | Simulated: the next bar's open, with slippage against you, unless you pick another policy | The same simulation | The broker's fills |
| Version | The one the Run dialog names | Frozen at the start; a new version needs a new test | The one you deployed; to run another, stop and deploy that |
| Needs | A saved strategy | A completed run of a Rules or Program strategy | A completed backtest, the Trade app on in the project, and a connected Alpaca paper account |

## Rules and assumptions

### Fills at the next bar's open

A strategy decides at a bar's close, and a market order fills at the next bar's open plus slippage, as the Report's **Fills** row states. See [One bar of delay](https://orbitalaip.com/docs/backtesting/when-trades-happen#one-bar-of-delay).

### Day market orders on paper

A Rules or Program deployment sends day market orders in whole shares that Alpaca's paper simulator fills, so a fill can land away from the backtest's price. See [Orders on Alpaca paper](https://orbitalaip.com/docs/trade/deploy-a-strategy#orders-on-alpaca-paper) and [Why a deploy is refused](https://orbitalaip.com/docs/trade/deploy-a-strategy#why-a-deploy-is-refused).

### Open positions at the end of a run

Every run keeps the positions it holds at the last close. They are marked at that close, with their entry costs charged but no exit slippage or commission. An exit decided at the last close does not fill; the position is reported open.

On the **Report**, the **At the end** row reads **Positions kept open, marked at the last close**. On the **Trades** tab they read **Open** under **Closed by**, with **Marked** on the exit leg. **Net profit** includes their [open P&L](https://orbitalaip.com/docs/glossary#open-pnl), shown as **Of which open**. Closed-trade statistics such as [win rate](https://orbitalaip.com/docs/glossary#win-rate), [profit factor](https://orbitalaip.com/docs/glossary#profit-factor) and [expectancy](https://orbitalaip.com/docs/glossary#expectancy) leave them out. **End of run** as an [exit reason](https://orbitalaip.com/docs/glossary#exit-reason) appears only on an older run that sold its positions at the last close.

A deployment never ends this way: **Stop** is final, sells nothing, and leaves what the strategy holds to its own exits. See [Manage a deployment](https://orbitalaip.com/docs/trade/manage-a-deployment#stop).

### Margin defaults

A run uses a cash account unless **Margin account** is on. With [margin](https://orbitalaip.com/docs/glossary#margin) on, the initial requirement is 50% and the maintenance requirement 25%. Shorts pay a borrow fee of 3% a year on their market value, accrued per calendar day. These figures are fixed; **Margin account** is the only margin setting a run takes.

A maintenance breach liquidates at the next open, deepest loss first, and each such exit reads **Margin call**. If equity reaches zero, the run liquidates everything and stops trading; those exits read **Account blown**, and ratio metrics are suppressed.

A Rules strategy that sells short is refused without margin on. A Program's short orders on a cash account are rejected during the run instead. On paper, a short is placed like any other entry under **Always-approve**, within the deployment's limits.

### Benchmark

Every run names a [benchmark](https://orbitalaip.com/docs/glossary#benchmark), SPY unless you change it. Another benchmark makes a new configuration of the same version, with its own trial count; see [Versions and configurations](https://orbitalaip.com/docs/backtesting/versions#versions-and-configurations).

From Claude or ChatGPT

- "What costs did my latest backtest assume, and what did it leave out?"
- "Does my latest run still hold positions at the end, and what is their open P&L?"
