Skip to main content

generate_futures_tickers

Function generate_futures_tickers 

Source
pub fn generate_futures_tickers(
    spec: &CommoditySpec,
    months: usize,
) -> Vec<(String, String)>
Expand description

Generate tickers for the next N contract months from today.

Walks the valid contract calendar for the root symbol so e.g. gold (Feb/Apr/Jun/Aug/Oct/Dec) doesn’t enumerate Jul/Sep/Nov tickers that don’t trade. The single source of truth for which months a root supports is futures_curve_months() in timeseries.rs; we fall back to every month only for roots not in that table.