Backtesting an options strategy
A strategy can look good on a P/L chart and still lose money over a year. A backtest replays it session by session over the past, on the option prices that were actually there, and shows what the rules would have done: how often they won, how much they lost when they lost, and whether all of it beat simply holding the stock.
Rules, not trades
A backtest needs rules a machine can follow without hindsight. For an options strategy that means:
- The legs: which rights, bought or sold, and how each strike is chosen, by delta (the 30-delta put), by distance out of the money, or as a wing a set width from another leg.
- The expiry: a target number of days, taken as the listed expiry nearest it.
- The exits: close at a share of the premium kept, at a loss of so much of it, or a set number of days before expiry; else hold to expiry.
- What follows assignment: for the wheel, selling calls on the shares; for a plain put sale, selling them.
What to measure
- Return and annualized return on the capital the strategy needs.
- Max drawdown: the largest fall from a peak. Premium-selling strategies win often and lose in lumps; the drawdown says how big the lumps were.
- Sharpe ratio: return per unit of volatility, to compare strategies that move differently.
- Win rate and trades: how many positions, how many won, how often assigned.
- Against buy and hold: the same capital in the stock over the same window. Many option strategies earn steadily and still trail the stock in a rising market.
The pitfalls
- Fills. A daily close is not a price you could have traded at; real fills cross a spread, wider for illiquid strikes. Count slippage and commissions, or a strategy that trades often will look better than it is.
- Missing prices. A contract that did not trade that day has no close. Filling it from a model is necessary but is not a market price; know how much of a result was modeled.
- One window. A year of rising prices flatters selling puts, and a year of chop flatters condors. Run several windows, including a sharp sell-off.
- Overfitting. Tuning the delta, the days, and the exits until the past looks best finds the rules that fit the past. Prefer settings that work across a range over the single best one.
- What is left out. Early assignment, dividends, and margin calls happen in trading. A backtest that ignores them should say so.
In Options Meerkat
Backtests are part of Pro. The backtest page (R) starts from a preset, the wheel, cash-secured puts, covered calls, bull put and bear call spreads, iron condors, short strangles, or long calls and puts, tuned by the short legs' delta, the days to expiry, and a spread's width, with take-profit, stop-loss, and days-to-expiry exits and a window of sessions. It runs on the server over each contract's real daily closes (OPRA day aggregates from Massive's Flat Files), with the underlying's splits applied, against buy and hold, and reports the return, annualized return, max drawdown, Sharpe, trades won, assignments, the net premium and costs, and the equity curve. A contract with no trade on a session is priced by Black-Scholes at its last implied volatility and counted, so each result says how much of it is modeled; assignment happens only at expiry, and dividends are not paid. Ask Meerkat, the chat, to backtest a strategy in a sentence and it writes the rules and runs them; optchain backtest does the same from the command line.