
A reliable calendar spread backtest needs four things: clean price history for the underlying, contract-accurate option or futures quotes for both legs, explicit rules for expiration and rolling, and realistic costs. Get any one wrong and the equity curve tells you about your data, not your strategy. This guide walks through each piece in the order you build it.
TL;DR
- A calendar spread pairs two contracts on the same underlying with the same strike but different expirations, so your test must model both legs and the time between them.
- Model expiration with contract-specific last trading times and settlement rules, not a generic final close.
- Option bid-ask spreads change with liquidity and moneyness, so a single fixed cost per trade will flatter the result.
- Judge results by drawdown, win/loss distribution and performance across volatility regimes, not by total return alone.
- Clean minute-bar data for the underlying or futures leg removes one whole class of errors before you start.
Table of Contents
- What you are actually testing
- Step 1: Write the rules before you touch data
- Step 2: Get the data right
- Step 3: Model expiration honestly
- Step 4: Entries, exits and adjustments
- Step 5: Costs, spreads and slippage
- Step 6: Read the results
- Common errors that inflate results
- Our perspective
- Where clean minute bars fit
- Get the data layer ready
- FAQ
- Sources
What you are actually testing
A calendar spread takes long and short positions on the same underlying with the same strike but different expiration dates. In the long version you sell the near-term option and buy the longer-term one, aiming to profit from time decay and a stable price. A reverse calendar spread does the opposite and aims to profit from volatility or a large move, as Investopedia's calendar spread entry explains.
That definition already tells you what the backtest has to capture:
- Two legs priced separately. The near leg decays faster than the far leg. Your test needs a quote for each, at each decision point.
- Implied volatility on both expirations. The structure is sensitive to the gap between near and far implied volatility, so a model that only tracks the underlying price will miss the main driver.
- A defined exit. The near leg expires first. What happens next (close the whole spread, roll the short leg, let the long leg run) must be a rule, not a judgment call made with hindsight.
The same logic applies to futures calendar spreads, where you hold a long and a short position in different delivery months of one contract. There the legs are futures prices instead of option premiums, and the roll mechanics matter even more. Spreads between contract months are not unique to equities either: calendar spreads in crypto futures trade in volume on large exchanges, and the same testing discipline applies.
Step 1: Write the rules before you touch data
A reproducible test starts with a written specification. If you cannot hand it to someone else and get the same trades, it is not reproducible. Fix these items first:
- Universe. Which underlyings, and why. Define the selection rule so it does not quietly use information from the future.
- Entry trigger. For example: enter when the near-month implied volatility is above the far-month by a set ratio, or on a fixed schedule such as a set number of days before the near expiration.
- Strike selection. At the money, a fixed delta, or a fixed distance from the spot. Pick one rule and keep it.
- Expiration pair. Which two expirations, such as the front monthly and the next monthly.
- Sizing. Fixed contracts or fixed capital at risk per trade.
- Exit rules. Profit target, stop, time exit, and what happens at near-leg expiration.
- Costs. Commission per contract, assumed fill price relative to the quote, and slippage.
Then freeze the specification. Run it once on an in-sample period, then once on a period you did not look at while designing it. Record the software version, the data version and the parameters alongside the results, so you can reproduce the run months later.
Step 2: Get the data right
This is where most calendar spread tests quietly fail. You need three layers of data.
Option quotes for both legs
For an options calendar you need historical option chains with bid and ask for every strike and expiration you might trade, not just end-of-day last prices. Last prices on thinly traded contracts can be stale or from a different time of day than the underlying close, which creates fake spread values. Check that your options source includes:
- bid, ask and, ideally, implied volatility and open interest per contract;
- expired contracts, not only those that exist today;
- timestamps that line up with the underlying data you use.
Historical option chains are specialized products, so source them from a dedicated options data vendor and read its documentation on how gaps and adjustments are handled.
Underlying and futures price history
The underlying leg drives your delta, your entry triggers and your exit checks. Gaps, bad ticks, duplicated bars and unexplained adjustments in this series contaminate every trade. For futures calendar spreads, you also need each delivery month as its own series, plus a consistent rule for how continuous contracts are stitched. Our guides on rolling rules for futures contracts and futures rollover methods cover why the stitching choice changes results.
Contract metadata
Keep a table of every contract's expiration date, last trading time, settlement style and multiplier. You will need it in the next step.
A data checklist before the first run
| Check | What to look for |
|---|---|
| Missing bars | Gaps during active sessions, not just holidays |
| Outliers | Prices that jump and revert within one bar |
| Crossed quotes | Bid above ask, or zero bids on contracts you assume you can sell |
| Time alignment | Option quotes and underlying bars stamped in the same time zone and session |
| Expired contracts | Present in the history, so dead trades are not silently excluded |
| Adjustments | Splits, dividends and roll adjustments documented |
The last two rows connect to a general issue: if the history only contains what survived, your test is biased. Our article on survivorship bias in backtesting shows how to spot it.
Step 3: Model expiration honestly
Expiration is the part of a calendar spread backtest that looks simplest and breaks most often. The short near leg expires while the long leg remains, so any shortcut at expiration changes your profit directly.
A common shortcut is to assume that every position settles at the final closing price of the underlying. Real contracts do not all work that way. Expirations should be modeled using each contract's last trading time, settlement reference, exercise method and delivery rules, as StratMill's analysis of options expiration in backtests argues. The same piece makes a point worth remembering: a neat single equity curve can hide untidy operational details around expiration and settlement, where small gaps between modeled and actual payoffs can dominate strategy profits.
For your test, that means writing down answers to these questions per contract type:
- Is settlement physical or cash, and which price is the reference?
- Is exercise American or European? Early exercise of a short leg is a real risk when it is in the money, especially around dividends.
- What is the last time you can trade the contract, and does your exit rule respect it?
- If the short leg is assigned, what happens to the long leg and to your cash?
A simple, defensible policy is to close the whole spread before the near leg's last trading session, at the quoted prices of that moment. It avoids modeling assignment, and you can test the assignment case separately as a stress scenario.
Step 4: Entries, exits and adjustments
Decide the fill timing explicitly. If your signal uses a bar's close, the earliest honest fill is the next bar's quote, not the same price that generated the signal. Testing at minute resolution makes this easier to get right, because the gap between signal and fill is a minute rather than a day.
For adjustments, choose from a short, pre-defined menu rather than improvising per trade:
- Roll the short leg to the next expiration when the near option nears expiry and the spread is still in range.
- Re-center by closing the spread and opening a new one at the current strike if the underlying has moved far from it.
- Stop out when the loss reaches a fixed fraction of the debit paid.
Each adjustment is a new trade with its own costs. A test that counts the roll as free overstates the strategy. If you are testing several underlyings together, multi-symbol backtesting deals with the portfolio-level bookkeeping.
Step 5: Costs, spreads and slippage
Calendar spreads involve four option transactions per round trip: open two legs, close two legs. Costs add up fast, and the bid-ask spread is usually the largest part.
The bid-ask spread on an option is not fixed. It varies with liquidity and moneyness, a point made in Figlewski's academic presentation on financial modeling in derivatives. For your test, that means:
- Do not apply one flat slippage number to every contract. Tie it to the quoted spread of that contract at that time.
- Run the strategy at several fill assumptions: at the mid, a fraction of the way to the bad side, and at the full bid-ask. If the edge disappears at the realistic assumption, you have learned something valuable.
- Count commissions and exchange fees per contract, per leg, on entry and exit.
- Skip trades where the quote is missing, crossed or has a zero bid, and report how many you skipped. Silent skipping is a form of cherry-picking.
For the futures leg and the underlying, our articles on modeling the spread in a backtest, transaction costs across regimes and simulating slippage with minute bars give concrete estimators you can adapt.
Step 6: Read the results
Total return is the least informative number. Look at:
- Maximum drawdown and its duration. Long calendars have limited loss per trade, but many small losses can stack.
- Win rate together with average win and average loss. A high win rate with rare large losses behaves very differently from the reverse.
- Distribution by volatility regime. Split trades by the level of implied volatility at entry and by whether volatility rose or fell. A long calendar is a bet on stability; a strategy that only worked in one calm year has not been validated.
- Distribution by underlying move. Group trades by how far the underlying moved between entry and near expiration. You should see the classic tent-shaped payoff in the data. If you do not, the model is probably wrong.
- Sensitivity to parameters. Shift strikes, entry days and exit rules by small amounts. A strategy that collapses with a one-day change is fitted to noise.
- Stability across years and underlyings. Report each year separately.
Common errors that inflate results
| Error | Why it misleads | Fix |
|---|---|---|
| Using last price instead of bid/ask | Stale prints create phantom profits | Use quotes, fill on the realistic side |
| Same-bar signal and fill | Trades on information you did not have yet | Fill on the next available quote |
| Ignoring early exercise and assignment | Understates short-leg risk | Close before expiry, stress-test assignment |
| Flat cost per trade | Underprices illiquid strikes | Scale costs by the quoted spread |
| Dropping expired or delisted contracts | Survivorship bias | Keep the full contract history |
| Tuning on the whole sample | Overfitting | Freeze rules, test out of sample |
| Unstitched or unadjusted futures series | Fake jumps at rolls | Use a documented roll and adjustment method |
Our perspective
Every backtest we see fail in practice fails at the data layer first. A calendar spread is an unforgiving structure: two legs, two clocks, and a payoff that depends on small differences. If the underlying or futures series has a gap, a bad tick or an undocumented adjustment, you cannot tell whether a trade lost money because the idea was wrong or because the input was.
That is why we focus on clean, verified minute-bar history. We collect and check our data bar by bar, document adjustments, and deliver complete datasets since 2014 that import directly into MT4 and MT5. Our engineers answer support questions directly, so when a result looks odd you can ask the people who built the file.
Our view is simple: fix the data, write the rules down, then argue about the strategy. A test built on trustworthy minute bars for the underlying and futures legs gives you a baseline you can reproduce, and a reproducible baseline is what lets you compare one version of a spread strategy against another.
Start
Where clean minute bars fit
Our datasets cover forex, metals, stock indices, bonds and commodities, including back-adjusted futures data, as complete one-time downloads. They suit the underlying and futures legs of your test: signals, entry timing, delta checks and stress scenarios on intraday moves. Pair them with option quotes from a dedicated options source and you control the part of the test you can control.
If you also run automated strategies, our write-ups on automated strategy management tools and MT4 portfolio backtesting show how to turn a single test into a portfolio view with realistic drawdowns.

Get the data layer ready
If your next calendar spread test needs a verified price history for the underlying or the futures legs, start with our historical data sets. They arrive complete and ready to import, so you spend your time on rules and results instead of cleaning files.

If you want ongoing access, the Annual Plan is €119 per year.
FAQ
Can I backtest a calendar spread with only end-of-day data?
You can get a rough first look, but daily last prices hide the bid-ask spread, stale quotes and intraday moves that decide whether a fill was achievable. Use bid and ask quotes for both legs where possible, and treat end-of-day results as a screening step, not proof.
How many trades do I need before trusting the result?
There is no universal number, but a result from a few dozen trades in one market regime is weak. Aim for many trades across several years and volatility environments, and check that the result holds in a period you did not use to design the rules.
Should I model early assignment?
Yes, at least as a stress test. A short near-term option that is in the money can be exercised early if it is American style. The simplest approach is to close the spread before the near leg's last trading session, then run a separate scenario that forces assignment and see how much it changes the outcome.
Does the same method work for futures calendar spreads?
The structure of the test is the same: written rules, separate series for each delivery month, explicit roll handling and realistic costs. The difference is that your legs are futures prices, so contract rolls and adjustment methods become the central data question.
Sources
- Calendar spread definition and long vs reverse structure, Investopedia
- What does an options backtest actually do at expiration? StratMill
- Thoughts on the Use of Financial Modeling in Derivatives, Figlewski, NYU Stern
- Calendar spreads in crypto futures, Cryptela
Recommended
- Spread Modeling for Backtests: 3 Estimators to Stress Test ML Edge
- Stop Fake Alpha: 5 Checks Quants Need for Hedging Backtesting Data
- Protect Your Backtest: 5-Step Audit for Handling Missing Bars
- Rolling Window Backtest: How to Build One That Holds Up
Related resources
Explore BacktestMarket's Expert Advisor robots to put the ideas in this article into practice.
