Interface Book<COOKIE>

  • All Superinterfaces:
    deltix.util.lang.CookieContainer<COOKIE>, deltix.qsrv.hf.pub.InstrumentIdentity
    All Known Subinterfaces:
    ConcurrentBook<COOKIE>
    All Known Implementing Classes:
    DefaultBook

    public interface Book<COOKIE>
    extends deltix.qsrv.hf.pub.InstrumentIdentity, deltix.util.lang.CookieContainer<COOKIE>
    Represents current order book for specific contract (InstrumentIdentity.getSymbol()) on specific exchange (getExchange()).

    There are two ways to iterate an order book:

    1. Active - you explore both levels using getSize(boolean) and getItem(int, boolean) methods.
    2. Passive - API walks you using BookWalker.
    • Method Detail

      • getLastUpdateTimestamp

        long getLastUpdateTimestamp()
        Returns time of last update
        Returns:
        time in millis
      • hasEntitlementId

        boolean hasEntitlementId()
        Returns:
        true if market data has data-access-control (DAC)
      • getEntitlementId

        rtmath.containers.BinaryArray getEntitlementId()
        Returns:
        market data has data-access-control (DAC) token that was used to build this order book
      • getExchange

        java.lang.CharSequence getExchange()
        Returns:
        Exchange or Liquidity Provider name that broadcasts this order book
      • getExchangeCode

        long getExchangeCode()
        Returns:
        encoded exchange name of the exchange or liquidity provider that broadcasts this order book. See ExchangeCodec
      • getSize

        int getSize​(boolean ask)
        Returns number of order book items on specific side (bid or ask) of order book
        Parameters:
        ask - specifies ask side of the book if true, otherwise bid side
        Returns:
        number of order book items on specified side
      • getItem

        BookItem getItem​(int index,
                         boolean ask)
        Returns:
        order book entry for specified depth and order book side
      • walk

        void walk​(BookWalker walker)
        Iterate current order book using provided callback
      • walk

        void walk​(BookWalker walker,
                  boolean ask)
        Iterate one side of order book using provided callback