Create a continuous returns series from a set of futures contracts by rolling on a given number of days to expiry.

roll_on_dte(contracts, roll_dte = 1, roll_cost = 0)

Arguments

contracts

List of dfs of futures with at least ticker/date/close columns

roll_dte

Calendar days to expiry to roll into next contract

cost

Percent cost of trading into next contract (total cost of trading out of current contract and into next contract)

Value

A continuous futures return series