Volume-Gated Contango/Backwardation (Front vs Back)
Volume-Gated Contango/Backwardation (Front vs Back)
A pragmatic futures-term-structure tool that combines liquidity signals with spread analysis to help you time rolls and gauge carry opportunities.
Key Features:
- Volume-Spike Trigger: Automatically detects when front-month trading volume surges above its historical norm (mean + 3× std dev) and only begins plotting the spread once real liquidity has rolled in.
- Percent Spread Pivot: Plots the daily front/back percent spread (back−front)/front×100(\text{back} - \text{front})/\text{front} \times 100(back−front)/front×100; above 0% indicates contango, below 0% indicates backwardation.
- Smoothed MA Overlay: Includes an adjustable moving average of the spread to filter noise and reveal underlying trends in contango/backwardation.
- Rollover Marker: Marks the exact bar where front-month volume first exceeds the threshold—ideal for visually confirming your roll point.
- Background Regime Shading: Subtle green/red shading highlights contango vs. backwardation regimes, but only after your volume-gate fires.
- Customizable Inputs: Tune lookback lengths, multiplier, volume floor, and MA period to match your preferred market dynamics.
Use this indicator to:
- Pinpoint when the market has truly shifted into the new front contract
- See at a glance whether carry is positive or negative
- Smooth out short-term noise and focus on structural shifts in the futures curve
- Automate alerts for roll timing and regime changes
A data-driven TradingView Pine v6 indicator that waits for genuine front-month volume spikes before plotting your front/back percent spread, then highlights contango (>0%) vs. backwardation (<0%) with adjustable moving-average smoothing.