VALYNOX
VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Market views

Basis trading in futures: what the basis is and how to test it

Basis trading holds spot and futures in opposite directions to profit from the gap (spot minus futures) changing as it converges to zero at expiry. It can be tested systematically only with an aligned spot series, contract-by-contract futures data and costs on both legs; for most retail traders the basis is more useful as a filter for a single-leg futures rule.

By · Published · updated · Editorial policy

Contents
  1. What is basis trading in futures?
  2. Why does the basis shrink to zero at expiry?
  3. How do cash-and-carry and index arbitrage use the basis?
  4. What data do you need to backtest a basis strategy?
  5. What are the risks and costs for a retail trader?
  6. Can you test a basis idea on the futures leg alone?
  7. Frequently asked questions
  8. References

What is basis trading in futures?

Basis trading in futures means holding the spot asset and its future in opposite directions to profit when the basis, spot price minus futures price, changes. Because the basis must reach zero at expiry, the trade is a bet on how it gets there. It can be tested systematically only with an aligned spot series, contract-by-contract futures data and a cost model for both legs.

The basis is the spot price minus the futures price of the same asset, measured at the same moment. The spot price is the price for immediate delivery: for an index future it is the index level itself, for gold it is the cash metal price. The gap works like the difference between a hotel room booked for tonight and the same room booked three months ahead. Neither price alone is the trade; the distance between them is.

The sign matters. With this definition, a negative basis means the future trades above spot (the market is in contango) and a positive basis means the future trades below spot (backwardation). Some textbooks and data vendors define the basis the other way round, as futures minus spot, so check the convention before you read a chart or write a rule.

The basis is a signed gap. With a hypothetical spot price of 100 and a futures price of 101, the basis is 100 minus 101, or minus 1, so the future trades above spot. Basis is a signed gap Spot minus futures, hypothetical Futures 101 Spot 100 Basis = −1 100 − 101 Negative basis: future above spot. So: check your data's sign first.
The basis is the signed gap between spot and futures, not a price. Here spot is 100, the future is 101, so the basis is −1.

A basis trader does not care whether the market rises or falls. Both legs move together, so the direction mostly cancels. What is left is the change in the gap. This is why the trade looks safe at first sight and why its real risks sit in places a directional trader never looks: financing, dividends, settlement rules and the cost of two sets of fills.

Why does the basis shrink to zero at expiry?

The basis must reach zero on the last trading day because the future settles to the spot price, and before that day its size is set mainly by the cost of carry: financing plus storage minus any income such as dividends. Convergence is the name for this movement of the basis toward zero as expiry approaches. On the final day a cash-settled index future is settled to a price the exchange computes from the index, and a deliverable commodity future turns into the commodity itself, so a gap between the two prices cannot survive.

The basis ends at zero. Two hypothetical paths, one starting above zero in backwardation and one starting below zero in contango, wobble over time and both reach zero at expiry, when the future settles to spot. The basis ends at zero Hypothetical paths to expiry 0 Backwardation Contango Expiry Both paths meet zero at expiry. So: trade the path, not the end.
Whether the basis starts negative or positive, it meets zero at settlement. The path in between is what a basis trader bets on.

Cost of carry is the net cost of holding the spot asset from today until expiry instead of holding the future. If the future were priced far above spot plus carry, anyone could buy spot, sell the future and wait, so the gap stays close to carry most of the time. One formula covers it:

fair futures price ≈ spot × (1 + (r − q) × t) + storage

Here r is the financing rate you pay to fund the spot position, q is the income the spot asset pays while you hold it (the dividend yield of an index), t is the time to expiry as a fraction of a year, and storage is what it costs to keep a physical commodity safe and insured. The fair basis before expiry is spot minus this fair futures price, so it is usually small and negative for an index with low dividends, and more negative for a commodity with storage costs.

Carry componentEquity index futureStorable commodity future
Financing costPushes the future above spotPushes the future above spot
Storage and insuranceNonePushes the future further above spot
Income while holdingDividends pull the future back downNone
Usual sign of the basisSmall, negative when financing exceeds dividendsNegative, unless supply is tight
Carry sets the fair basis. For an index future, financing pushes the future above spot and dividends pull it back, leaving a small gap. For a commodity future, financing and storage both push it above spot, leaving a bigger gap. Carry sets the fair basis Bar length: future above spot Index: small gap + Financing − Dividends Commodity: bigger gap + Financing + Storage Same idea, different parts. So: model carry for your market.
The same idea, built from different parts: an index future nets financing against dividends, a commodity future adds storage and has no income.

When the actual basis is far from this fair value, something else is at work: a shortage of the physical commodity, a dividend the market expects but your model does not, or a stressed funding market. The roll gaps that these states create in a continuous series are covered in backwardation and contango in futures backtests.

How do cash-and-carry and index arbitrage use the basis?

A cash-and-carry trade buys spot, sells the future and holds to expiry, so it earns the basis only when the future is priced above spot by more than the carry costs; index arbitrage is the same idea on a stock index against its future. Cash-and-carry is the trade that enforces the fair-value formula above: it is the reason the basis rarely drifts far from carry for long.

  1. Buy the spot asset and sell the future on the same day, at prices stamped at the same moment. The difference between them is your starting basis.
  2. Pay the carry costs while holding: financing on the spot position, storage for a commodity, and collect any dividends.
  3. At expiry the future settles to spot. The gap closes by rule, not by luck.
  4. Your result equals the starting basis minus carry costs minus fees. If the starting gap was smaller than carry plus fees, the trade loses even though convergence happened exactly as planned.
Cash-and-carry in four steps: buy spot and sell the future, pay carry costs while holding, the future settles to spot at expiry, and the result is the starting gap minus carry and fees; repeat only when the gap is larger than these costs. How cash-and-carry works The profit is fixed on day one 1 2 3 4 Buy spot, sell future Pay carry costs Settles to spot Gap − carry − fees Only if gap > cost Profit = starting gap − costs. So: enter only if gap > carry + fees.
Cash-and-carry in four steps. The profit comes from the starting gap, and only the part that survives carry and fees.

Index arbitrage is cash-and-carry where the spot leg is a basket of the index stocks, or an ETF that tracks the index, and the futures leg is the index future. The reverse trade exists too: sell the basket short, buy the future, and wait for a future priced below fair value to converge upward.

Hypothetical example

An index trades at 100 and its future, 90 days from expiry, at 101. The starting basis is 100 − 101 = −1, so the future is 1 point above spot. Financing 100 points for 90 days costs 0.5 points and the basket pays 0.2 points of dividends in that time, so carry is 0.3 points. A cash-and-carry trade locks in 1 − 0.3 = 0.7 points before fees and slippage. If the future had traded at 100.2, the starting gap of 0.2 would be smaller than carry, and the trade would lose 0.1 points before any fee was paid.

In liquid markets this trade is done at scale by firms with low financing and near-zero fees, which keeps the gap small. That is the first reason a retail trader should expect the gross edge to be thin, and the costs section below shows why.

What data do you need to backtest a basis strategy?

A basis backtest needs a spot series stamped at the same moment as each futures bar, every individual contract rather than a continuous series, the interest rate and income assumptions for carry, and the exact expiry and settlement rules of the exchange. An ordinary single-leg backtest gets by with one continuous series, session times and a cost per round trip. A basis test needs five more things, and a missing one produces a basis that looks tradable but was never there.

InputOrdinary futures backtestBasis backtest
Futures pricesOne continuous, back-adjusted seriesEach contract month separately, with its expiry date
Spot pricesNot neededA spot or index series stamped at the same time as each futures bar
Financing rateNot neededA rate series for the period, to compute carry
Income or storageNot neededExpected dividends or storage cost per contract period
Settlement ruleRoll date onlyHow and when the exchange computes the final settlement price
CostsOne round tripTwo round trips, plus financing or borrow on the spot leg
A basis backtest needs four inputs that an ordinary futures backtest skips: a spot series stamped at the same time, each contract month kept separately, a financing rate with income or storage, and the exchange settlement rule. Basis tests need more data Inputs an ordinary test skips Ordinary Basis Spot, same time Each contract Rate and income Settlement rule none none none none Back-adjusting erases the basis. So: keep each contract separate.
A continuous futures series alone cannot measure the basis, because back-adjustment erases the very gap you want to trade.

Time alignment is the input most often done wrong. An index level is computed from the last trades of its member stocks, so it lags the future by seconds in normal trading and by much more at the open, when many stocks have not traded yet. A basis computed from a 09:00 futures bar and a 09:00 index print can show a large gap that no one could have traded. Use index values from well inside the session, or a tradable ETF price, and never a daily index close against a futures settlement price taken at a different time; the difference between those two stamps is explained in futures settlement price versus close.

The continuous series problem is the second trap. Back-adjustment shifts old contracts up or down so the chart has no roll gaps, which is right for a trend rule and wrong for a basis rule, because the shift is the basis. Keep every contract month as its own series with its own expiry. For Taiwan index futures, the expiry calendar is listed in the free TAIEX futures settlement dates tool, and the exchange's contract page is the source for how the final settlement price is computed; exchanges can change these rules, so check the page for the period you test.

What are the risks and costs for a retail trader?

The basis can widen before it converges, so a retail basis trade pays margin, financing and two sets of commission and slippage while waiting, and the gross edge is usually a fraction of what those costs add up to. Convergence is certain at expiry; the path is not. A future that is 1 point above spot today can be 2 points above spot next week, and a trader who entered at 1 sees a loss on the futures leg that the spot leg does not fully offset until expiry.

Costs take the whole gap: in a hypothetical retail cash-and-carry trade the starting edge is 0.7 points, and fees of 0.2, slippage of 0.2 and extra financing of 0.3 points leave nothing. Costs take the whole gap Hypothetical retail trade, in points Edge +0.7 Fees −0.2 Slippage −0.2 Financing −0.3 Net 0.0 Retail costs eat the whole edge. So: charge both legs in every test.
The gap can widen before it closes, and the trade pays for two legs the whole way. The starting basis is the only edge there is.

The cost list for a two-leg trade is longer than most traders expect:

  • Commission and exchange fees on both legs, entry and exit, so four fills instead of two. The free futures contract calculator turns the tick size of the futures leg into money per contract.
  • Slippage on both legs, and the legs are rarely filled at the same instant, so the basis you capture is worse than the basis you saw.
  • Financing for the spot leg. A retail account funds an ETF or stock basket at a retail rate, which is higher than the rate built into the future's fair value.
  • Margin on the futures leg, with the daily mark-to-market: a widening basis produces margin calls on the futures side while the spot side shows a paper gain you cannot use to meet them.
  • Borrow cost and recall risk if the trade is the reverse one with a short spot leg.
  • Tracking error when the spot leg is an ETF rather than the exact index basket, plus dividends that arrive on a different schedule than assumed.

Hypothetical example

Take the 0.7 points locked in by the cash-and-carry example above on an index at 100. Suppose commission and fees cost 0.05 points per leg per side, so 0.2 points for four fills, and slippage costs one tick of 0.05 per leg per side, another 0.2 points. The retail financing rate is 0.3 points higher than the rate in the fair-value formula over the 90 days. Costs total 0.7 points, and the trade finishes at zero before any tracking error or dividend surprise. The same trade run by a firm with near-zero fees and wholesale financing keeps most of the 0.7.

The general method for charging these costs inside a test, and the rule that the average trade should be several times the round-trip cost, is covered in trading costs in backtests. For a basis trade the comparison is harsher because there are two round trips and the gross edge is capped by carry.

Can you test a basis idea on the futures leg alone?

A trader without a spot leg can still test whether the basis level or its change carries information for a single-leg futures rule, which is a normal backtest with the basis used as a filter or signal. The question changes from "can I capture the gap" to "does the gap tell me something about the next move in the future". That is a directional test, with one round trip of cost, and it is where most retail traders should start.

  1. Compute the basis for every bar from the aligned spot and futures prices, using one contract at a time and switching contracts on your roll date. For Taiwan traders, how the premium and discount of TAIEX futures against the index behaves is described in TAIEX futures versus the index: basis, premium and discount.
  2. Turn the basis into a rule. Two common forms: a level rule, such as "take long signals only when the basis is below a set level", and a change rule, such as "take signals only when the basis has moved in one direction over the last N bars". Fix the level or N before the test, or search a small range and check that neighbouring values behave alike.
  3. Run the futures-only strategy with the rule on and with it off, same data, same sessions, same costs, same execution. Compare the two reports after costs.
Testing the basis as a filter in three steps: compute the basis for every bar, turn it into a filter rule, then run the futures-only strategy with the filter on and off and compare both results after costs. Test the basis as a filter Futures leg only, one round trip 1 2 3 Compute basis per bar Turn it into a filter Run with it on and off Keep it if the average trade rises. So: compare both runs after costs.
A basis series becomes a filter in three steps. The on-versus-off comparison, after costs, is the whole test.

What a good and a bad result look like. A useful filter removes a share of the losing trades, so the trade count falls moderately and the average trade after costs rises, with the gain spread across most years of the test. A filter that cuts the trade count in half while the average trade barely moves has only shrunk the sample, and a filter whose whole gain comes from one expiry cycle has found a story, not a pattern. Judge the comparison with the split described in in-sample versus out-of-sample testing, so the filter level is chosen on one part of the history and graded on the rest. In AlphaPrime (Valynox), backtesting charges fees and slippage and fills on the next bar in every evaluation, so when you compare a filtered and an unfiltered rule the only thing that differs between the two runs is the filter itself.

A first check you can do this week: for the contract that expired most recently in your market, compute spot minus futures for each session from listing to expiry and plot it against days to expiry. If the line does not end close to zero at settlement, your spot and futures stamps are not aligned, and no basis rule built on that series can be trusted until they are.

Frequently asked questions

What does basis mean in futures trading?

The basis is the spot price of an asset minus the price of its futures contract, measured at the same moment. It is a signed gap, not a price: negative when the future trades above spot, positive when it trades below. Some sources define it as futures minus spot, so check the convention before reading a chart or writing a rule.

Is a negative basis the same as contango?

With basis defined as spot minus futures, yes: a negative basis means the future is priced above spot, which is contango. A positive basis means the future is below spot, which is backwardation. The usual cause of contango is the cost of carry, financing plus storage minus income, which makes a future worth slightly more than spot until expiry.

What is basis risk?

Basis risk is the chance that the gap between spot and futures moves against you before it converges. A hedger who sells futures against a spot position is protected from the direction of the market but not from the basis widening. For a basis trader the gap is the whole trade, so basis risk is the main risk, and it shows up as margin calls on the futures leg while waiting for expiry.

Can a retail trader do cash-and-carry arbitrage?

The mechanics are open to anyone: buy spot, sell the future, hold to expiry. The problem is cost. A retail account pays two sets of commission and slippage and a retail financing rate on the spot leg, while the gross edge is capped by carry and is kept small by firms that trade the same gap at lower cost. Most retail traders get more from testing the basis as a filter on a single-leg futures rule.

What is a basis trade in bond futures?

In Treasury markets a basis trade buys a cash bond and sells the bond future against it, or the reverse, to capture the difference between the two prices after carry. The same convergence logic applies, with the added detail that bond futures can be settled by delivering one of several eligible bonds, so the trade is priced against the bond that is cheapest to deliver. It is typically run with high leverage by funds with low financing costs.

References

  • CME Group. E-mini Nasdaq-100 Futures Contract Specs. https://www.cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html
  • Taiwan Futures Exchange. Mini-TAIEX Futures. https://www.taifex.com.tw/enl/eng2/mTX