Classes Files

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. More…

Inherits from Wombat.MamdaMsgListener, Wombat.MamdaOrderBookRecap, Wombat.MamdaOrderBookDelta, Wombat.MamdaOrderBookGap, Wombat.MamdaBasicEvent

Public Functions

  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)

Detailed Description

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.

Public Functions Documentation

function MamdaOrderBookListener

MamdaOrderBookListener()

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

function MamdaOrderBookListener

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:

  • fullBook
  • deltaBook

function addHandler

void addHandler(
    MamdaOrderBookHandler handler
)

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

Parameters:

  • handler

function addIgnoreEntryId

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:

  • id

function removeIgnoreEntryId

void removeIgnoreEntryId(
    string id
)

(Future) Remove an entry ID to ignore. See addIgnoreEntryId.

Parameters:

  • id

function clear

void clear()

Clear all cached data fields.

function getSrcTime

DateTime getSrcTime()

Return:

Reimplements: Wombat::MamdaBasicEvent::getSrcTime

function getActivityTime

DateTime getActivityTime()

Return:

Reimplements: Wombat::MamdaBasicEvent::getActivityTime

function getEventSeqNum

long getEventSeqNum()

Return:

Reimplements: Wombat::MamdaBasicEvent::getEventSeqNum

function getEventTime

DateTime getEventTime()

Return:

Reimplements: Wombat::MamdaBasicEvent::getEventTime

function getSymbolFieldState

MamdaFieldState getSymbolFieldState()

function getPartIdFieldState

MamdaFieldState getPartIdFieldState()

function getSrcTimeFieldState

MamdaFieldState getSrcTimeFieldState()

Returns the field state.

Return: Source time Field State

Reimplements: Wombat::MamdaBasicEvent::getSrcTimeFieldState

function getActivityTimeFieldState

MamdaFieldState getActivityTimeFieldState()

Returns the field state.

Return: Activity time Field State

Reimplements: Wombat::MamdaBasicEvent::getActivityTimeFieldState

function getLineTimeFieldState

MamdaFieldState getLineTimeFieldState()

function getSendTimeFieldState

MamdaFieldState getSendTimeFieldState()

function getEventSeqNumFieldState

MamdaFieldState getEventSeqNumFieldState()

Returns the field state.

Return: Source sequence number Field State

Reimplements: Wombat::MamdaBasicEvent::getEventSeqNumFieldState

function getEventTimeFieldState

MamdaFieldState getEventTimeFieldState()

Returns the field state.

Return: Event Time Field State

Reimplements: Wombat::MamdaBasicEvent::getEventTimeFieldState

function getFullOrderBook

MamdaOrderBook getFullOrderBook()

Return:

Reimplements: Wombat::MamdaOrderBookRecap::getFullOrderBook

function getDeltaOrderBook

MamdaOrderBook getDeltaOrderBook()

Return:

Reimplements: Wombat::MamdaOrderBookDelta::getDeltaOrderBook

function getBeginGapSeqNum

long getBeginGapSeqNum()

Return:

Reimplements: Wombat::MamdaOrderBookGap::getBeginGapSeqNum

function getEndGapSeqNum

long getEndGapSeqNum()

Return:

Reimplements: Wombat::MamdaOrderBookGap::getEndGapSeqNum

function getSeqNum

long getSeqNum()

Return:

function getBookSnapshot

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

function getDeepBookSnapshot

MamdaOrderBook getDeepBookSnapshot()

Returns a deep copy of the underlying order book.

Return: A deep snapshot of the current Order Book

function setUpdateInconsistentBook

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:

  • update

function onMsg

void onMsg(
    MamdaSubscription subscription,
    MamaMsg msg,
    mamaMsgType msgType
)

Parameters:

  • subscription
  • msg
  • msgType

Reimplements: Wombat::MamdaMsgListener::onMsg


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