def __init__(self, data_source): self._data_source = data_source try: self.get_risk_free_rate = data_source.get_risk_free_rate except AttributeError: pass InstrumentMixin.__init__(self, data_source.get_all_instruments()) TradingDatesMixin.__init__(self, data_source.get_trading_calendar())
def __init__(self, data_source): self._data_source = data_source try: self.get_risk_free_rate = data_source.get_risk_free_rate except AttributeError: pass InstrumentMixin.__init__(self, data_source.get_all_instruments()) TradingDatesMixin.__init__(self, data_source.get_trading_calendar())
def __init__(self, data_source, price_board): self._data_source = data_source self._price_board = price_board try: self.get_risk_free_rate = data_source.get_risk_free_rate except AttributeError: pass InstrumentMixin.__init__(self, data_source.get_all_instruments()) try: trading_calendars = data_source.get_trading_calendars() except NotImplementedError: # forward compatible trading_calendars = { TRADING_CALENDAR_TYPE.EXCHANGE: data_source.get_trading_calendar() } TradingDatesMixin.__init__(self, trading_calendars)