Identify both delivery months
Near and deferred gold futures can have different prices at the same time. A continuous series switches its price source according to a data rule, while a position belongs to a particular contract month. Record the contract codes, session, quote unit and switch time.
A six-point difference at the instant of the roll
Suppose a long near-month position opened at 98 closes at 100, and the deferred contract opens at 106 at the same moment. Before fees, the old contract earns two points per unit. The new position starts at zero P&L. A stitched chart jumps six points between contracts. Only a subsequent move from 106 to 107 earns a point on the new position.
Reconstruct the roll from its two fills
A backtest may calculate trend signals on an adjusted continuous series. Reconstruct P&L from each contract’s fills, size and multiplier, accounting for fees and slippage on both legs. A calendar spread compares delivery months. A futures–spot basis also needs a matched spot price. Keep those calculations separate.