Calculates time series of ratio of 2 instruments using available data. Returned object will be ratios calculated using Bids, Asks, and Mids, or Opens, Closes, and Adjusteds.
determines (or estimates) the expiration from an xts object by either finding the last row that is not NA or by passing the name/symbol of the xts object to expires.character
The columns needed by this version of the function are primary_id and month_cycle. primary_id should match the primary_id of the instrument describing the root contract. month_cycle should contain a comma delimited string describing the month sequence to use, e.g. "F,G,H,J,K,M,N,Q,U,V,X,Z" for all months using the standard futures letters, or "H,M,U,Z" for quarters, or "Mar,Jun,Sep,Dec" for quarters as three-letter month abbreviations, etc. The correct values will vary based on your data source.