Trading Dev AcademyFree quant education

Free lesson · FX and commodities

Rolling futures without inventing a cash profit

Open interactive lessonPractice calculationsExplore labs

Start with the idea

Replacing a near contract with a farther contract changes the reference price; the gap itself is not an immediate realized return.

Symbols, units & horizon
  • n: signed contracts closed
  • m: units per contract
  • F_near,entry and F_near,exit: prices of the same near contract in currency per unit
  • c: closing costs in currency
  • Π_close: close-period profit
  • new farther-contract entry has no immediate price-change P&L before costs

When and why to use this

Reconcile continuous-futures backtests with actual contract-level P&L.

Replacing a near contract with a farther contract changes the reference price; the gap itself is not an immediate realized return.

A futures roll closes the existing contract and opens another. Profit on the closing position depends on its original entry or last settlement, not simply on the price difference between two different maturities. Back-adjusted continuous charts can conceal this distinction.

Curve shape influences subsequent convergence and strategy economics, but a mechanically adjusted price jump is not a cash flow. Maintain individual contract IDs, multipliers, entry/exit prices, fees and separate collateral interest.

Πclose=nm(Fnear,exit−Fnear,entry)−c
Same-contract close-out accounting identity

Rolling futures without inventing a cash profit

  1. Identify the old contract and its actual entry or last-settlement price.
  2. Compute its marked profit through the closing price.
  3. Record the new contract at its own entry reference and treat future price changes separately; do not book the cross-maturity gap as current profit.
Work it by hand

Long one old contract entered at 78, exits at 80, multiplier 1000, costs 20: close profit $1,980. Buying the next contract at 83 does not immediately create a $3,000 loss.

Apply it in a strategy

  • Freeze inputs at the stated decision time and record their units.
  • Reconcile continuous-futures backtests with actual contract-level P&L.
  • Recompute the example, then change the material assumption and explain the difference.

Research deliverable

Rolling futures without inventing a cash profit: produce the worked calculation, a timestamped input record and a written decision addressing this limitation: Back-adjustment methods can create artificial returns if transformed levels are treated as actual transaction prices.

These are synthetic mechanics examples, not historical performance or paper replications. Module evidence and research boundaries record the 12 September 2026 review.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

# Python 3.10+; standard library and NumPy only.
# Synthetic teaching inputs; conventions and units are defined in the notation above.
def roll_close(contracts,multiplier,old_entry,old_exit,closing_cost):
    if multiplier<=0 or closing_cost<0: raise ValueError('Invalid multiplier or cost')
    return contracts*multiplier*(old_exit-old_entry)-closing_cost

assert roll_close(1,1000,78,80,20)==1980
print(roll_close(1,1000,78,80,20))

Continue learning

FX & Commodities: Quotes, Carry, Curves & Hedges — all lessons
  1. Invert both units and bid/ask sides
  2. Triangular conversion with executable sides
  3. Covered interest parity by matching currency cash flows
  4. Unhedged carry leaves exchange-rate risk
  5. Storage and convenience yield in a commodity forward
  6. Futures profit and margin cash demands
  7. Rolling futures without inventing a cash profit
  8. Minimum-variance cross hedging and basis risk

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations