'Parameters
root_symbol : str
The root symbol for the contract chain.
dt : Timestamp
The datetime for which to retrieve the current contract.
offset : int
The offset from the primary contract.
0 is the primary, 1 is the secondary, etc.
Returns
Future
The active future contract at the given dt.'

def get_contract_center(self, root_symbol, dt, offset):

    oc = self.asset_finder.get_ordered_contracts(root_symbol)
    session = self.trading_calendar.minute_to_session_label(dt)
    front = oc.contract_before_auto_close(session.value)
    back = oc.contract_at_offset(front, 1, dt.value)
    if (back is None):
        return front
    primary = self._active_contract(oc, front, back, session)
    return oc.contract_at_offset(primary, offset, session.value)
