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
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.
inline MamdaOrderBookListener()
Create an order book listener using internally created data structures for the full and delta order books.
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).
inline void addHandler(
MamdaOrderBookHandler handler
)
Parameters:
Add a specialized order book handler. Currently, only one handler can (and must) be registered.
inline void addIgnoreEntryId(
String id
)
Parameters:
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.
inline void removeIgnoreEntryId(
String id
)
Parameters:
Remove an entry ID to ignore.
inline void clear()
Clear all cached data fields.
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.
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.
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
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
inline long getEventSeqNum()
Return: Source sequence number. The exchange generated sequence number.
Reimplements: com::wombat::mamda::MamdaBasicEvent::getEventSeqNum
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
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.
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.
inline short getMsgQual()
inline MamdaOrderBook getOrderBook()
Return: The full order book.
Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookClear::getOrderBook
Returns the full orderbook related to this clear event.
inline long getBeginGapSeqNum()
Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookGap::getBeginGapSeqNum
Beginning sequence number in a detected gap event.
inline long getEndGapSeqNum()
Reimplements: com::wombat::mamda::orderbook::MamdaOrderBookGap::getEndGapSeqNum
Ending sequence number in a detected gap event.
inline void setProcessMarketOrders(
boolean process
)
inline boolean getProcessMarketOrders()
inline short getSymbolFieldState()
Return: symbol Field State
Reimplements: com::wombat::mamda::MamdaBasicRecap::getSymbolFieldState
inline short getPartIdFieldState()
Return: participant ID Field State
Reimplements: com::wombat::mamda::MamdaBasicRecap::getPartIdFieldState
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
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
inline short getLineTimeFieldState()
Return: line time Field State
Reimplements: com::wombat::mamda::MamdaBasicRecap::getLineTimeFieldState
inline short getSendTimeFieldState()
Return: send time Field State
Reimplements: com::wombat::mamda::MamdaBasicRecap::getSendTimeFieldState
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
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
inline void setProcessEntries(
boolean process
)
Parameters:
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.)
inline MamdaOrderBook getBookSnapshot()
Return: A snapshot of the current Order Book
Returns a deep, writeable copy of the underlying order book.
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.
inline void onMsg(
MamdaSubscription subscription,
MamaMsg msg,
short msgType
)
Reimplements: com::wombat::mamda::MamdaMsgListener::onMsg
Implementation of MamdaListener interface.
static inline MamdaOrderBook getBookSnapShot(
String symbol
)
Updated on 2023-03-31 at 15:30:39 +0100