Normalize prices before subtracting them
A valid basis compares an executable spot exposure with the specific futures contract that hedges it. A quote in cents per bushel cannot be subtracted from dollars per bushel. Convert the quote first, then choose a multiplier consistent with that price scale. An index price difference is in points; its multiplier converts points to currency per contract. An ETF price and its index level are not interchangeable spot prices.
Record both symbols, contract month, currency, delivery grade and location, quote timestamp, and settlement reference. Use calendar time to the actual final settlement, not an approximate number of trading bars. This calculator uses D/365 even in a leap year; contracts or funding desks may use a different day count.
Basis, annualization and carry formulas
Let F be futures, S spot, T = D/365, M the price multiplier and N matched contracts. Annual rates r, u, q and y below are decimals. The sign convention here is F − S; the CFTC glossary notes that commodity basis is typically cash minus futures, so its sign is reversed.
| Measure | Formula | Interpretation |
|---|---|---|
| Basis | F − S | Price units, before costs |
| Simple annualized basis | ((F − S) / S) / T | Multiply by 100 for percent |
| Compound annualized basis | (F / S)^(1 / T) − 1 | Assumes identical reinvestment periods |
| Continuous fair value | S × exp((r + u − q − y) × T) | Storage adds cost; income and convenience subtract |
| Simple financing | S × r × T × M × N | Full cash leg financed |
| Net cash-and-carry | (F − S)MN − SrTMN − SuTMN + SqTMN − fees × N | No cash credit for convenience yield |
These are scenario formulas for proportional carry. The continuous model treats the entered rates as continuously compounded; the cash ledger treats the same numerical rates as simple annual rates, with income and expenses aggregated at expiry. Use cash-flow dates and your actual interest convention for execution analysis. CME explains index fair value as cash value adjusted for financing, dividends and time, and distinguishes that estimate from the market price.
Worked cash-and-carry example
The reset values are hypothetical: spot 100 and futures 102 in USD per unit, 90 calendar days, a 100-unit contract, one contract, financing 5%, storage 2%, no cash income or convenience yield, and USD 10 total execution costs. Buy 100 units of spot and sell one matching dated future.
Basis is 2 per unit, or USD 200 gross. The 2% premium annualizes to 8.1111% simple or 8.3624% compound. Simple financing is 10,000 × 0.05 × 90/365 = USD 123.2877; storage is USD 49.3151. After USD 10 costs, the convergence estimate is 200 − 123.2877 − 49.3151 − 10 = USD 17.3973. Its cash breakeven futures price is 101.8260. The separate continuous theoretical price is 100 × exp(0.07 × 90/365) = 101.7410.
If both legs settle against the same price of 95, the spot loses USD 500 and the short future gains USD 700, preserving the USD 200 gross spread before carry. Closing early when basis is 3 instead of zero produces (2 − 3) × 100 = a USD 100 loss before carry. A terminal convergence estimate does not describe the cash needed to survive interim price moves.
What convergence does and does not remove
Delivery or cash settlement links a dated future to its specified settlement asset or index. CME describes delivery as the link behind grain convergence. That mechanism does not force an unrelated local spot quote to equal the futures price: transport, quality and delivery location can leave a residual difference.
- Margin calls on the short future can require cash before gains on the spot leg are realized. This ledger excludes variation-margin financing, collateral interest and liquidation constraints.
- Dividend estimates may differ from realized payments. Fixed storage bills and dated dividends need explicit cash flows rather than proportional annual yields. Convenience yield is the benefit of access to inventory, not a bank deposit.
- A negative basis does not establish reverse cash-and-carry profitability. Shorting the cash asset requires borrow availability, borrow fees and replacement of distributions; this tool models long cash and short futures only.
- Cross-currency trades need FX hedging and both funding curves. Bond futures need conversion factors and delivery options. Inverse crypto contracts need their own payoff model. Those adjustments are outside this calculator.
Research the signal on TradingView
Choose a dated futures symbol and a comparable cash series. Align sessions and observation times, flag stale or missing quotes, and keep contract expiry explicit. A back-adjusted continuous series can change historical price levels and rolls; it is unsuitable as an unqualified executable basis series.
Pine can request other symbols and timeframes, so a basis indicator can display matched observations. Such data requests do not create a portfolio execution model. A single-chart strategy report cannot prove the combined cash leg, futures margin, financing and delivery economics. Keep a separate two-leg ledger when evaluating those results.
Use Pine Script AI Coding Agent to draft a monitor from explicit rules, then inspect symbol mapping, quote timing and costs. For a supported chart strategy, Strategy Optimizer can compare input combinations. Reserve another date range for validation; an optimized chart result is not a cash-and-carry portfolio backtest.
Sources and formulas reviewed October 18, 2026. Educational scenario analysis only, not investment advice. No live quotes, execution, financing availability or profitability is verified by this calculator.