SPY 0DTE LAB
Buy
Automation

Backtesting and Paper Trading an Options Bot: How to Know Your Rules Work

By SPY 0DTE Lab · Published · 10 min read

How to test an automated options strategy before risking money: what a backtest can and cannot tell you, the biases that make results look better than they are, modeling fills and fees, how many trades you need, and how to run a paper trading period that means something.

Building an options bot is the easy part now that AI coding assistants can write most of the code. Knowing whether the rules inside it actually work is harder, and it is where most of the money is lost. This guide covers the two tests every strategy should pass before it trades real money: a backtest you can trust and a paper trading period that means something.

What a backtest can and cannot tell you

A backtest replays historical data through your rules and records the trades they would have taken. It can show that the logic is coherent, that the strategy is not obviously broken, and how it behaved in specific past conditions. It cannot show that the edge will persist. Markets change, and the past only contains one path out of many that could have happened.

The three biases that flatter results

  • Lookahead bias. Using information before it was available: a bar's close to decide a trade during that bar, a day's high at noon, or data revised later. One line of code can turn a losing strategy into a winning backtest.
  • Overfitting. Adjusting thresholds until the past looks great. Every extra parameter tuned on the same data makes the backtest better and the live results less predictable.
  • Optimistic fills. Assuming trades at the midpoint or the last price. Same-day options often have wide spreads, and a multi-leg order may fill well away from the mid.

Model fills and costs honestly

  1. Fill at a realistic priceAssume you buy near the ask and sell near the bid, or a fixed slippage from the mid that you can defend.
  2. Include every feeCommissions and per-contract fees add up quickly on multi-leg same-day trades.
  3. Respect liquidityDo not assume you can trade size that the market did not show at that moment.
  4. Handle the closeModel what happens at expiration, including settlement, instead of assuming a clean exit.

Read the results, not just the total

Look atWhy it matters
Number of tradesA few dozen trades can show a profit by luck alone
Largest loss and worst weekSize the account to survive these, not the average day
Maximum drawdownThe deepest fall from a peak is what you have to live through
Average win versus average lossA high win rate means little if one loss erases many wins
Results by periodAn edge that came from one month is not an edge

Keep part of your data aside and never tune on it. If the strategy only works on the data you tuned it with, you have described the past, not found a rule.

Paper trading: test the plumbing

Paper trading runs the bot against live market data with simulated orders. Its main job is to prove the software works: that it reads data on time, places the right orders, tracks partial fills, recovers from a restart and never leaves a position unmanaged. Before you start, write down:

  • How long the period lasts, so you don't stop early after a good week or a bad one.
  • What counts as a pass: no software errors, every rule exercised, results within the range the backtest suggested.
  • What you log: every decision with its reason, every order and every fill, so you can explain each trade.

Remember that paper fills are usually kinder than real ones. Going live with a small size is the final test of fills.

Start from a written specification

Testing only means something when the rules are fixed and written down before the test begins. Our Iron Condor and SPY 0DTEAuto-Trading Prompts give an AI coding assistant a complete entry specification to build and test against, and our own results are on the public record. Past results do not guarantee future results.

Frequently asked questions

What is backtesting in options trading?

Running a strategy's rules over historical market data to see what trades it would have made and what they would have returned. It is a check on the logic, not a forecast.

Why do backtests look better than live results?

Usually because of lookahead bias (using information that was not available yet), overfitting (tuning rules to past noise) or optimistic fills (assuming trades at prices you could not actually get).

How many trades do I need to trust a backtest?

More than most people think. A few dozen trades can easily show a profit by luck. Look for hundreds of trades across different market conditions, and check that results hold on data you did not tune on.

Is paper trading the same as live trading?

No. Paper fills are often more generous than real ones, and there is no emotional pressure. Paper trading is best for proving the software places, tracks and closes orders correctly.

How long should I paper trade an options bot?

Long enough to see a range of sessions, including fast and quiet days, and to exercise every rule at least a few times. Decide the length and the pass criteria before you begin.

This article is general, educational information, not investment advice or a recommendation to buy or sell any security. Options, especially same-day options, involve substantial risk and can lose their full value within minutes. Past results do not guarantee future results. Read the Risk Disclosure.

More from Learn →