← ClaudeAtlas

futures-continuous-contractslisted

Build and use a futures price series correctly — a continuous contract does not exist in the market, it is stitched, and the stitching method changes your answer. TRIGGER - futures, continuous contract, back-adjusted, Panama adjustment, ratio adjustment, roll, roll yield, contango, backwardation, front month, expiry, first notice day, open interest roll, CME, Globex, ES, CL, NG, VX, GC, ZN; joining futures bars to an equity calendar; "my futures backtest returns look wrong"; negative prices in a price series; norgatedata, databento continuous symbols, yfinance CL=F or ES=F. SKIP for Chinese futures and 夜盘 (china-trading-stack) and for crypto perpetuals, which have funding rather than rolls (crypto-data-and-execution).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Futures continuous contracts **There is no such thing as "the price of crude oil".** There is a sequence of expiring contracts, and any long series is a construction you chose. Most of what follows was **executed**, not read. ## 1. 🚨 The adjustment method and the return operator must match This is a 2×2, not a preference. ✅ Measured over 180 rolls against true dollar P&L: | Series | `diff()` | `pct_change()` | |---|---|---| | **difference** (Panama / back-adjusted) | ✅ **exact — $0 error** on true dollar P&L | 🚨 corr **0.97** in mild contango, **−0.005** in backwardation | | **ratio** (proportional) | 🚨 off by **36.9%** of total P&L | ✅ **exact — corr 1.000000, max err 0.000000** | | **unadjusted** (spliced) | 🚨 wrong at every roll | 🚨 wrong at every roll | > **difference + `diff()` → dollar P&L. ratio + `pct_change()` → percentage returns. > unadjusted → levels only (margin, tick value, limit moves). Never cross the pairs.** ✅ Reproduced in `scripts/continuous_contract.py`: over 8 synthetic years the unadjusted series implies **+6.2%/yr against a true −12.9%/yr — 19 percentage points wrong**, while ratio matches the truth to **+0.0 pp**. ## 2. 🚨 Back-adjusted prices go negative, and you can predict when A difference-adjusted series subtracts the cumulative roll gap from all history. Under sustained backwardation the subtraction eventually exceeds the price level. 🔑 **Crossing time = `1 / (annual roll yield)` years — independent of the price level.** At crud