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. More…
Inherits from Wombat.MamdaMsgListener, Wombat.MamdaOrderBookRecap, Wombat.MamdaOrderBookDelta, Wombat.MamdaOrderBookGap, Wombat.MamdaBasicEvent
Name | |
---|---|
MamdaOrderBookListener() Create an order book listener using internally created data structures for the full and delta order books. |
|
MamdaOrderBookListener(MamdaOrderBook fullBook, MamdaOrderBook deltaBook) Create an order book listener using user-provided data structures for the full and delta order books. It is an error for the deltaBook to be NULL. If the fullBook is NULL, then there will be no cached order book (and therefore nothing to apply the delta order books to); this may be useful in some circumstances. |
|
void | addHandler(MamdaOrderBookHandler handler) Add a specialized order book handler. Currently, only one handler can (and must) be registered. |
void | addIgnoreEntryId(string id) (Future) 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. |
void | removeIgnoreEntryId(string id) (Future) Remove an entry ID to ignore. See addIgnoreEntryId. |
void | clear() Clear all cached data fields. |
DateTime | getSrcTime() |
DateTime | getActivityTime() |
long | getEventSeqNum() |
DateTime | getEventTime() |
MamdaFieldState | getSymbolFieldState() |
MamdaFieldState | getPartIdFieldState() |
MamdaFieldState | getSrcTimeFieldState() Returns the field state. |
MamdaFieldState | getActivityTimeFieldState() Returns the field state. |
MamdaFieldState | getLineTimeFieldState() |
MamdaFieldState | getSendTimeFieldState() |
MamdaFieldState | getEventSeqNumFieldState() Returns the field state. |
MamdaFieldState | getEventTimeFieldState() Returns the field state. |
MamdaOrderBook | getFullOrderBook() |
MamdaOrderBook | getDeltaOrderBook() |
long | getBeginGapSeqNum() |
long | getEndGapSeqNum() |
long | getSeqNum() |
MamdaOrderBook | getBookSnapshot() Returns a shallow copy of the underlying order book. As such this method should not be called from a separate thread. The recommended use of this method is to use a timer on the same queue as data for this book is being dispatched and grab the snapshot at regular intervals. |
MamdaOrderBook | getDeepBookSnapshot() Returns a deep copy of the underlying order book. |
void | setUpdateInconsistentBook(bool update) Whether to handle or ignore updates sent for an inconsistent book. A book may be in an inconsistent state if there has been a gap on the sequence of update (delta) messages. Default is to not update (and wait for a recap). |
void | onMsg(MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) |
class Wombat::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.
MamdaOrderBookListener()
Create an order book listener using internally created data structures for the full and delta order books.
MamdaOrderBookListener(
MamdaOrderBook fullBook,
MamdaOrderBook deltaBook
)
Create an order book listener using user-provided data structures for the full and delta order books. It is an error for the deltaBook to be NULL. If the fullBook is NULL, then there will be no cached order book (and therefore nothing to apply the delta order books to); this may be useful in some circumstances.
Parameters:
void addHandler(
MamdaOrderBookHandler handler
)
Add a specialized order book handler. Currently, only one handler can (and must) be registered.
Parameters:
void addIgnoreEntryId(
string id
)
(Future) 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.
Parameters:
void removeIgnoreEntryId(
string id
)
(Future) Remove an entry ID to ignore. See addIgnoreEntryId.
Parameters:
void clear()
Clear all cached data fields.
DateTime getSrcTime()
Return:
Reimplements: Wombat::MamdaBasicEvent::getSrcTime
DateTime getActivityTime()
Return:
Reimplements: Wombat::MamdaBasicEvent::getActivityTime
long getEventSeqNum()
Return:
Reimplements: Wombat::MamdaBasicEvent::getEventSeqNum
DateTime getEventTime()
Return:
Reimplements: Wombat::MamdaBasicEvent::getEventTime
MamdaFieldState getSymbolFieldState()
MamdaFieldState getPartIdFieldState()
MamdaFieldState getSrcTimeFieldState()
Returns the field state.
Return: Source time Field State
Reimplements: Wombat::MamdaBasicEvent::getSrcTimeFieldState
MamdaFieldState getActivityTimeFieldState()
Returns the field state.
Return: Activity time Field State
Reimplements: Wombat::MamdaBasicEvent::getActivityTimeFieldState
MamdaFieldState getLineTimeFieldState()
MamdaFieldState getSendTimeFieldState()
MamdaFieldState getEventSeqNumFieldState()
Returns the field state.
Return: Source sequence number Field State
Reimplements: Wombat::MamdaBasicEvent::getEventSeqNumFieldState
MamdaFieldState getEventTimeFieldState()
Returns the field state.
Return: Event Time Field State
Reimplements: Wombat::MamdaBasicEvent::getEventTimeFieldState
MamdaOrderBook getFullOrderBook()
Return:
Reimplements: Wombat::MamdaOrderBookRecap::getFullOrderBook
MamdaOrderBook getDeltaOrderBook()
Return:
Reimplements: Wombat::MamdaOrderBookDelta::getDeltaOrderBook
long getBeginGapSeqNum()
Return:
Reimplements: Wombat::MamdaOrderBookGap::getBeginGapSeqNum
long getEndGapSeqNum()
Return:
Reimplements: Wombat::MamdaOrderBookGap::getEndGapSeqNum
long getSeqNum()
Return:
MamdaOrderBook getBookSnapshot()
Returns a shallow copy of the underlying order book. As such this method should not be called from a separate thread. The recommended use of this method is to use a timer on the same queue as data for this book is being dispatched and grab the snapshot at regular intervals.
Return: A snapshot of the current Order Book
MamdaOrderBook getDeepBookSnapshot()
Returns a deep copy of the underlying order book.
Return: A deep snapshot of the current Order Book
void setUpdateInconsistentBook(
bool update
)
Whether to handle or ignore updates sent for an inconsistent book. A book may be in an inconsistent state if there has been a gap on the sequence of update (delta) messages. Default is to not update (and wait for a recap).
Parameters:
void onMsg(
MamdaSubscription subscription,
MamaMsg msg,
mamaMsgType msgType
)
Parameters:
Reimplements: Wombat::MamdaMsgListener::onMsg
Updated on 2023-03-31 at 15:30:17 +0100