Interface Layer1ApiDataListener

All Known Subinterfaces:
Layer1ApiAdapter, Layer1ApiDataAdapter, Layer1ApiListener, OnlineValueCalculatorAdapter, StrategyUpdateGenerator
All Known Implementing Classes:
Layer1ApiDepthFreezer, Layer1ApiInjectorRelay, Layer1ApiRelay, Layer1ApiStrategiesEchoMessagesLayer, Layer1ApiUpstreamRelay

@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class) public interface Layer1ApiDataListener
Listener for market data events: trades, market-by-price depth and market mode.

Prices are expressed in ticks, i.e. the real price divided by InstrumentInfo.pips of the instrument reported in Layer1ApiInstrumentListener.onInstrumentAdded(String, velox.api.layer1.data.InstrumentInfo).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onDepth(String alias, boolean isBid, int price, int size)
    Depth data update.
    void
    onMarketMode(String alias, MarketMode marketMode)
    Market mode update.
    void
    onTrade(String alias, double price, int size, TradeInfo tradeInfo)
    Trade
  • Method Details

    • onTrade

      void onTrade(String alias, double price, int size, TradeInfo tradeInfo)
      Trade
      Parameters:
      alias - instrument alias
      price - price in the same units as in depth update (e.g. if pips=25 then price=1000 means 25000).
      size - trade size
      tradeInfo - additional information about the trade, e.g. aggressor side and whether it is an OTC trade
    • onDepth

      void onDepth(String alias, boolean isBid, int price, int size)
      Depth data update. This is an absolute update, not a delta: the size becomes the total size at that price level. A size of 0 removes the level from the book. Bookmap sends the full initial book as a sequence of these calls after Layer1ApiInstrumentListener.onInstrumentAdded(java.lang.String, velox.api.layer1.data.InstrumentInfo).
      Parameters:
      alias - instrument alias
      isBid - true if it is for bids, false for asks
      price - price where size changed, in ticks
      size - new total size at the level, 0 to remove the level
    • onMarketMode

      void onMarketMode(String alias, MarketMode marketMode)
      Market mode update. Only sent when the mode changes, so most instruments receive it rarely or never.
      Parameters:
      alias - instrument alias
      marketMode - new mode