Calendar-Based Roll Rules for Energy and Grain Futures
Summary
This module describes calendar rules for rolling several futures series: crude oil, NBP natural gas, refined products including RBOB, grains, and ethanol. The rules use contract-specific termination conventions, such as dates near the 25th or 15th of a month, the last business day, the penultimate business day, or the third business day. When a target date is a holiday, the methods seek an earlier available business date. The crude oil description also flags that expiration conventions may have changed over time and points users toward checking historical exchange advisories.
A plotting helper compares the first contract’s close with the second contract’s open, calculates their percentage premium, and shades positive and negative regions as contango and backwardation. These routines support historical futures data preparation and curve-state inspection, but the module does not specify a trading signal or report strategy performance. The roll assumptions depend on contract specifications and date availability; researchers should verify the relevant exchange rules and historical changes before relying on rolled data in analysis.
Key ideas
- The module assigns different calendar-based roll dates to energy and grain futures contracts.
- Holiday handling shifts target dates to earlier dates available in the dataset.
- The crude oil roll description warns that termination conventions may change over time.
- A plotting helper visualizes the relative price of nearby contracts as contango or backwardation.
- The code defines data-handling conventions rather than a complete trading strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.