docs: def marketPrice(self) -> float:
          """
          Return the first available one of
  
          * last price if within current bid/ask;
          * average of bid and ask (midpoint);
          * close price.
          """
          price = self.last if (
              self.hasBidAsk() and self.bid <= self.last <= self.ask) else \
              self.midpoint()
          if isNan(price):
              price = self.close
          return price