コード例 #1
0
 def check_market_open(self):
     instrument = self.get_instrument()
     if instrument["state"] != "Open" and instrument["state"] != "Closed":
         raise errors.MarketClosedError(
             "The instrument %s is not open. State: %s" %
             (self.symbol, instrument["state"]))
     return True
コード例 #2
0
    def check_market_open(self):
        logger.info("[ExchangeInterface][check_market_open]")

        instrument = self.get_instrument()
        if instrument["state"] != "Open" and instrument["state"] != "Closed":
            raise errors.MarketClosedError(
                "The instrument %s is not open. State: %s" %
                (self.symbol, instrument["state"]))
コード例 #3
0
 def check_market_open(self):
     instrument = self.get_instrument()
     if instrument["state"] not in ['Open', 'Closed']:
         raise errors.MarketClosedError(
             f"Market {self.symbol} not open. State: {instrument['state']}"
         )