Classes Files

com::wombat::mamda::orderbook::MamdaOrderBookListener

More…

Inherits from com.wombat.mamda.MamdaMsgListener, com.wombat.mamda.orderbook.MamdaOrderBookClear, com.wombat.mamda.orderbook.MamdaOrderBookRecap, com.wombat.mamda.orderbook.MamdaOrderBookGap, com.wombat.mamda.MamdaBasicEvent, com.wombat.mamda.MamdaBasicRecap

Public Functions

  Name
  MamdaOrderBookListener()
  MamdaOrderBookListener(MamdaOrderBook fullBook)
void addHandler(MamdaOrderBookHandler handler)
void addIgnoreEntryId(String id)
void removeIgnoreEntryId(String id)
void clear()
String getSymbol()
String getPartId()
MamaDateTime getSrcTime()
MamaDateTime getActivityTime()
long getEventSeqNum()
MamaDateTime getEventTime()
MamaDateTime getLineTime()
MamaDateTime getSendTime()
short getMsgQual()
MamdaOrderBook getOrderBook()
long getBeginGapSeqNum()
long getEndGapSeqNum()
void setProcessMarketOrders(boolean process)
boolean getProcessMarketOrders()
short getSymbolFieldState()
short getPartIdFieldState()
short getSrcTimeFieldState()
short getActivityTimeFieldState()
short getLineTimeFieldState()
short getSendTimeFieldState()
short getEventTimeFieldState()
short getEventSeqNumFieldState()
void setProcessEntries(boolean process)
MamdaOrderBook getBookSnapshot()
MamdaOrderBook getReadOnlyBookSnapshot()
void onMsg(MamdaSubscription subscription, MamaMsg msg, short msgType)
MamdaOrderBook getBookSnapShot(String symbol)

Detailed Description

class com::wombat::mamda::orderbook::MamdaOrderBookListener;

MamdaOrderBookListener is a class that specializes in handling order book updates. Developers provide their own implementation of the MamdaOrderBookHandler interface and will be delivered notifications for order book recaps and deltas. Notifications for order book deltas include the delta itself as well as the full order book with deltas applied. An obvious application for this MAMDA class is any kind of program trading application that looks at depth of book.

Note: The MamdaOrderBookListener class caches the order book. Among other reasons, caching of these fields makes it possible to provide complete trade-related callbacks, even when the publisher (e.g., feed handler) is only publishing deltas containing modified fields.

Public Functions Documentation

function MamdaOrderBookListener

inline MamdaOrderBookListener()

Create an order book listener using internally created data structures for the full and delta order books.

function MamdaOrderBookListener

inline MamdaOrderBookListener(
    MamdaOrderBook fullBook
)

Parameters:

Create an order book listener using an optional user-provided object for the full order book. If “fullBook” is NULL, an object will be allocated internally. If this listener is destroyed then the full order book object will only be destroyed if it was created by the listener (i.e., if fullBook was passed as NULL in this constructor).

function addHandler

inline void addHandler(
    MamdaOrderBookHandler handler
)

Parameters:

  • handler The hadler registered to receive order book update callbacks.

Add a specialized order book handler. Currently, only one handler can (and must) be registered.

function addIgnoreEntryId

inline void addIgnoreEntryId(
    String id
)

Parameters:

  • id The id of the participant to ignore when process book updates.

Add an entry ID to ignore. This only makes sense when the entry type is participant ID (as opposed to order ID). All order book updates for this entry ID will be ignored.

function removeIgnoreEntryId

inline void removeIgnoreEntryId(
    String id
)

Parameters:

  • id The id of the participant whose update will be subsequently processed as part of the book.

See: addIgnoreEntryId(String)

Remove an entry ID to ignore.

function clear

inline void clear()

Clear all cached data fields.

function getSymbol

inline String getSymbol()

Return: Symbol. This is the “well-known” symbol for the security, including any symbology mapping performed by the publisher.

Reimplements: com::wombat::mamda::MamdaBasicRecap::getSymbol

Get the string symbol for the instrument.

function getPartId

inline String getPartId()

Return: Participant ID. This may be an exchange identifier, a market maker ID, etc., or NULL (if this is not related to any specific participant).

Reimplements: com::wombat::mamda::MamdaBasicRecap::getPartId

Get the participant identifier.

function getSrcTime

inline MamaDateTime getSrcTime()

Return: Source time. Typically, the exchange generated feed time stamp. This is often the same as the “event time”, because many feeds do not distinguish between the actual event time and when the exchange sent the message.

Reimplements: com::wombat::mamda::MamdaBasicEvent::getSrcTime

function getActivityTime

inline MamaDateTime getActivityTime()

Return: Activity time. A feed handler generated time stamp representing when the data item was last updated.

Reimplements: com::wombat::mamda::MamdaBasicEvent::getActivityTime

function getEventSeqNum

inline long getEventSeqNum()

Return: Source sequence number. The exchange generated sequence number.

Reimplements: com::wombat::mamda::MamdaBasicEvent::getEventSeqNum

function getEventTime

inline MamaDateTime getEventTime()

Return: Event time. Typically, when the event actually occurred. This is often the same as the “source time”, because many feeds do not distinguish between the actual event time and when the exchange sent the message.

Reimplements: com::wombat::mamda::MamdaBasicEvent::getEventTime

function getLineTime

inline MamaDateTime getLineTime()

Return: Line time. A feed handler (or similar publisher) time stamp representing the time that such publisher received the update message pertaining to the event. If clocks are properly synchronized and the source time (see above) is accurate enough, then the difference between the source time and line time is the latency between the data source and the feed handler.

Reimplements: com::wombat::mamda::MamdaBasicRecap::getLineTime

Get the line time of the update.

function getSendTime

inline MamaDateTime getSendTime()

Return: Send time. A feed handler (or similar publisher) time stamp representing the time that such publisher sent the current message. The difference between the line time and send time is the latency within the feed handler itself. Also, if clocks are properly synchronized then the difference between the send time and current time is the latency within the market data distribution framework (i.e. MAMA and the underlying middleware).

Reimplements: com::wombat::mamda::MamdaBasicRecap::getSendTime

Get the send time of the update.

function getMsgQual

inline short getMsgQual()

function getOrderBook

inline MamdaOrderBook getOrderBook()

Return: The full order book.

Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookClear::getOrderBook

Returns the full orderbook related to this clear event.

function getBeginGapSeqNum

inline long getBeginGapSeqNum()

Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookGap::getBeginGapSeqNum

Beginning sequence number in a detected gap event.

function getEndGapSeqNum

inline long getEndGapSeqNum()

Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookGap::getEndGapSeqNum

Ending sequence number in a detected gap event.

function setProcessMarketOrders

inline void setProcessMarketOrders(
    boolean process
)

function getProcessMarketOrders

inline boolean getProcessMarketOrders()

function getSymbolFieldState

inline short getSymbolFieldState()

Return: symbol Field State

Reimplements: com::wombat::mamda::MamdaBasicRecap::getSymbolFieldState

function getPartIdFieldState

inline short getPartIdFieldState()

Return: participant ID Field State

Reimplements: com::wombat::mamda::MamdaBasicRecap::getPartIdFieldState

function getSrcTimeFieldState

inline short getSrcTimeFieldState()

Reimplements: com::wombat::mamda::MamdaBasicEvent::getSrcTimeFieldState

return Source time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated

function getActivityTimeFieldState

inline short getActivityTimeFieldState()

Reimplements: com::wombat::mamda::MamdaBasicEvent::getActivityTimeFieldState

return Activity time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated

function getLineTimeFieldState

inline short getLineTimeFieldState()

Return: line time Field State

Reimplements: com::wombat::mamda::MamdaBasicRecap::getLineTimeFieldState

function getSendTimeFieldState

inline short getSendTimeFieldState()

Return: send time Field State

Reimplements: com::wombat::mamda::MamdaBasicRecap::getSendTimeFieldState

function getEventTimeFieldState

inline short getEventTimeFieldState()

Reimplements: com::wombat::mamda::MamdaBasicEvent::getEventTimeFieldState

return event time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated

function getEventSeqNumFieldState

inline short getEventSeqNumFieldState()

Reimplements: com::wombat::mamda::MamdaBasicEvent::getEventSeqNumFieldState

return source sequence number Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated

function setProcessEntries

inline void setProcessEntries(
    boolean process
)

Parameters:

  • process Whether to process entries in books.

Set whether we are interested in “entry level” information at all. Many applications only care about price level information. (Default is to process entry level information.)

function getBookSnapshot

inline MamdaOrderBook getBookSnapshot()

Return: A snapshot of the current Order Book

Returns a deep, writeable copy of the underlying order book.

function getReadOnlyBookSnapshot

inline MamdaOrderBook getReadOnlyBookSnapshot()

Return: A deep snapshot of the current Order Book

Returns a deep, read only, copy of the underlying order book. This method is faster than the writeable getBookSnapshot.

function onMsg

inline void onMsg(
    MamdaSubscription subscription,
    MamaMsg msg,
    short msgType
)

Reimplements: com::wombat::mamda::MamdaMsgListener::onMsg

Implementation of MamdaListener interface.

function getBookSnapShot

static inline MamdaOrderBook getBookSnapShot(
    String symbol
)

Updated on 2023-03-31 at 15:30:39 +0100