Create a continuous returns series from a set of futures contracts by rolling into the adjacent contract with the highest open interest.

"Sees the future" in that it trades into the next contract at the close of the day on which max open interest switches. This is OK because it is usually obvious from intraday volumes that max open interest has switched.

Example: GC - roll from G to J on 19 Jan 2021. On the 19th, sell G and buy J. Get the (15-19 close-2-close - 19th is a Monday) return to G on the 19th, and the (19-20 close-2-close) return to J on the 20th.

Costs show up in the return on the day after the roll. This is largely an arbitrary accounting decision: we trade out of one contract and into another at the close on on roll day, which affects:

  • the return to the contract we trade out of on roll day, and

  • the return to the contract we trade into on roll day plus 1. Here, the entire cost shows up in the return to the new contract on roll day plus 1. This is a simplifying but arbitrary accounting decision.

roll_on_oi(contracts, roll_cost = 0)

Arguments

contracts

List of dfs of futures date/price/open interest

cost

Percent cost of trading into next contract

Value

A continuous futures return series