Classes Files

com::wombat::mamda::orderbook::MamdaOrderBookPriceLevel

Public Functions

  Name
  MamdaOrderBookPriceLevel()
  MamdaOrderBookPriceLevel(MamdaOrderBookPriceLevel copy)
  MamdaOrderBookPriceLevel(double price, char side)
void clear()
void copy(MamdaOrderBookPriceLevel copy)
void copy(MamdaBookAtomicLevel copy)
void copy(MamdaBookAtomicLevelEntry copy)
void setPrice(MamaPrice price)
void setPrice(double price)
void setSize(double size)
void setSizeChange(double size)
void setNumEntries(double numEntries)
void setSide(char side)
void setAction(char action)
void setTime(MamaDateTime time)
void setOrderType(char orderType)
char getOrderType()
boolean empty()
void setDetails(MamdaOrderBookPriceLevel level)
void setDetails(MamdaBookAtomicLevel level)
void setDetails(MamdaBookAtomicLevelEntry levelEntry)
void addEntry(MamdaOrderBookEntry entry)
void addEntry(MamdaOrderBookEntry entry, long entryPosition)
void updateEntry(MamdaOrderBookEntry entry)
void updateEntryPosition(String entryId, long entryPosition)
void updateEntry(MamdaBookAtomicLevelEntry levelEntry)
void removeEntry(MamdaOrderBookEntry entry)
void removeEntry(MamdaBookAtomicLevelEntry levelEntry)
Iterator entryIterator()
void checkNotExist(MamdaOrderBookEntry entry)
void checkNotExist(MamdaBookAtomicLevelEntry levelEntry)
void markAllDeleted()
void setAsDifference(MamdaOrderBookPriceLevel lhs, MamdaOrderBookPriceLevel rhs)
MamaPrice getPrice()
double getSize()
double getSizeChange()
double getNumEntries()
int getNumEntriesTotal()
char getSide()
char getAction()
MamaDateTime getTime()
void assertEqual(MamdaOrderBookPriceLevel rhs)
String getSymbol()
void removeEntryById(MamdaOrderBookEntry entry)
void removeEntryById(MamdaBookAtomicLevelEntry levelEntry)
void addEntriesFromLevel(MamdaOrderBookPriceLevel bookLevel, MamdaOrderBookEntryFilter filter, MamdaOrderBookBasicDeltaList delta)
void deleteEntriesFromSource(MamaSource source, MamdaOrderBookBasicDeltaList delta)
boolean reevaluate()
MamdaOrderBookEntry getEntryAtPosition(long pos)
long getEntryPositionInPriceLevel(String entryId)
MamdaOrderBookEntry findOrCreateEntry(String id)
MamdaOrderBookEntry findOrCreateEntry(String id, long entryPosition)
MamdaOrderBookEntry findEntry(String id)
void setStrictChecking(boolean strict)

Protected Functions

  Name
MamdaOrderBook getOrderBook()
void setOrderBook(MamdaOrderBook book)

Public Attributes

  Name
final char ACTION_ADD
final char ACTION_UPDATE
final char ACTION_DELETE
final char ACTION_UNKNOWN
final char SIDE_BID
final char SIDE_ASK
final char SIDE_UNKNOWN
final char LEVEL_LIMIT
final char LEVEL_MARKET
final char LEVEL_UNKNOWN

Public Functions Documentation

function MamdaOrderBookPriceLevel

inline MamdaOrderBookPriceLevel()

Default constructor.

function MamdaOrderBookPriceLevel

inline MamdaOrderBookPriceLevel(
    MamdaOrderBookPriceLevel copy
)

Parameters:

Construct a price level object which is a shallow copy of the original.

function MamdaOrderBookPriceLevel

inline MamdaOrderBookPriceLevel(
    double price,
    char side
)

function clear

inline void clear()

Clear the pricelevel

function copy

inline void copy(
    MamdaOrderBookPriceLevel copy
)

Parameters:

Copy a price level object which is an exact and deep copy of the original.

function copy

inline void copy(
    MamdaBookAtomicLevel copy
)

Parameters:

Copy an atomic price level object which is an exact and deep copy of the original.

function copy

inline void copy(
    MamdaBookAtomicLevelEntry copy
)

Parameters:

Copy a price level object which is an exact and deep copy of the original.

function setPrice

inline void setPrice(
    MamaPrice price
)

function setPrice

inline void setPrice(
    double price
)

function setSize

inline void setSize(
    double size
)

function setSizeChange

inline void setSizeChange(
    double size
)

function setNumEntries

inline void setNumEntries(
    double numEntries
)

function setSide

inline void setSide(
    char side
)

function setAction

inline void setAction(
    char action
)

function setTime

inline void setTime(
    MamaDateTime time
)

function setOrderType

inline void setOrderType(
    char orderType
)

function getOrderType

inline char getOrderType()

function empty

inline boolean empty()

Return: Whether there are no entries for this level.

Return whether there are no entries for this level.

function setDetails

inline void setDetails(
    MamdaOrderBookPriceLevel level
)

Parameters:

  • level The price level object from which the details are being obtained.

Take the details from level and apply them to this level. This does not update entries within the level, only information pertaining to the level itself. It is intended that this method should not be used externally to the API.

function setDetails

inline void setDetails(
    MamdaBookAtomicLevel level
)

Parameters:

  • level The atomic price level object from which the details are being obtained.

Take the details from atomic level and apply them to this level. This does not update entries within the level, only information pertaining to the level itself. It is intended that this method should not be used externally to the API.

function setDetails

inline void setDetails(
    MamdaBookAtomicLevelEntry levelEntry
)

Parameters:

  • levelEntry The atomic price levelEntry object from which the details are being obtained.

Take the details from atomic levelEntry and apply them to this levelEntry. This update entries within the level. It is intended that this method should not be used externally to the API.

function addEntry

inline void addEntry(
    MamdaOrderBookEntry entry
)

Parameters:

  • entry The new entry to be added to the level.

See: MamdaOrderBookEntry

Add a new order book entry to the price level.

function addEntry

inline void addEntry(
    MamdaOrderBookEntry entry,
    long entryPosition
)

Parameters:

  • entry The new entry to be added to the level.
  • entryPosition The position (indexed from 1) where the entry should be added.

See: MamdaOrderBookEntry

Add a new order book entry to the price level at a specified position.

function updateEntry

inline void updateEntry(
    MamdaOrderBookEntry entry
)

Parameters:

  • entry An instance of [MamdaOrderBookEntry](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookEntry.html) with the new details for the entry in the level.

See: MamdaOrderBookEntry

Update the details of an existing entry in the level.

function updateEntryPosition

inline void updateEntryPosition(
    String entryId,
    long entryPosition
)

Parameters:

  • entryId An instance of [MamdaOrderBookEntry](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookEntry.html) with the new details for the entry in the level.
  • entryPosition Position of the Entry within the Price Level.

See: MamdaOrderBookEntry

Update the entry position of an existing entry in the level.

function updateEntry

inline void updateEntry(
    MamdaBookAtomicLevelEntry levelEntry
)

Parameters:

  • levelEntry An instance of [MamdaBookAtomicLevelEntry](interfacecom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaBookAtomicLevelEntry.html) with the new details for the entry in the level.

See: MamdaOrderBookEntry

Update the details of an existing entry in the level, where the update details are provied by an atomic levelEntry.

function removeEntry

inline void removeEntry(
    MamdaOrderBookEntry entry
)

Parameters:

  • entry The entry which is to be removed from the price level.

See: MamdaOrderBookEntry

Remove an order book entry from the price level.

function removeEntry

inline void removeEntry(
    MamdaBookAtomicLevelEntry levelEntry
)

Parameters:

  • levelEntry The entry which is to be removed from the price level.

See: MamdaOrderBookEntry

Remove an order book entry from the price level, where the delete details are provied by an atomic levelEntry.

function entryIterator

inline Iterator entryIterator()

Return: Iterator The iterator for the price level entries

Returns a java.util.Iterator for all entries within this level. Price Level entries are represented by the [MamdaOrderBookEntry](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookEntry.html) class.

function checkNotExist

inline void checkNotExist(
    MamdaOrderBookEntry entry
)

Parameters:

  • entry The entry whose presence in the level is being determined.

Exceptions:

If the provided order book entry exists in the price level a [MamdaOrderBookException](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookException.html) exception is thrown. Otherwise the method simply returns.

function checkNotExist

inline void checkNotExist(
    MamdaBookAtomicLevelEntry levelEntry
)

Parameters:

  • levelEntry The entry whose presence in the level is being determined.

Exceptions:

If the provided levelEntry entry exists in the price level, as a OrderBookEntry, a [MamdaOrderBookException](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookException.html) exception is thrown. Otherwise the method simply returns.

function markAllDeleted

inline void markAllDeleted()

Mark everything in this price level as deleted, including entries.

function setAsDifference

inline void setAsDifference(
    MamdaOrderBookPriceLevel lhs,
    MamdaOrderBookPriceLevel rhs
)

function getPrice

inline MamaPrice getPrice()

Return: The price for this level.

Return the price for this level.

function getSize

inline double getSize()

Return: The total size for this level.

Return the total size (across all entries) for this level.

function getSizeChange

inline double getSizeChange()

Return: The changed size for this level.

Return the size change for this (presumably delta) level. This attribute is only of interest for delta order books. For full order books, this field will be equal to the size of the price level.

function getNumEntries

inline double getNumEntries()

Return: The actual number of entries for this level.

Return the actual number of entries for this level. The actual number of entries may not equate to the number of entries that can be iterated over if: (a) the feed does not provide the actual entries, or (b) the price level is just a delta.

function getNumEntriesTotal

inline int getNumEntriesTotal()

function getSide

inline char getSide()

Return: The side of the book for this level.

Return the side (bid/ask) of the book for this level.

function getAction

inline char getAction()

Return: The action for this level.

Return the action for this price level. All price levels for a full book are marked with ACTION_ADD.

function getTime

inline MamaDateTime getTime()

Return: The time stamp for when the price level was last updated.

Return the time stamp for when the price level was last updated.

function assertEqual

inline void assertEqual(
    MamdaOrderBookPriceLevel rhs
)

Exceptions:

Order book price level equality verification. A MamdaOrderBookException is thrown if the price levels are not equal, along with the reason for the inequality.

function getSymbol

inline String getSymbol()

function removeEntryById

inline void removeEntryById(
    MamdaOrderBookEntry entry
)

function removeEntryById

inline void removeEntryById(
    MamdaBookAtomicLevelEntry levelEntry
)

function addEntriesFromLevel

inline void addEntriesFromLevel(
    MamdaOrderBookPriceLevel bookLevel,
    MamdaOrderBookEntryFilter filter,
    MamdaOrderBookBasicDeltaList delta
)

function deleteEntriesFromSource

inline void deleteEntriesFromSource(
    MamaSource source,
    MamdaOrderBookBasicDeltaList delta
)

function reevaluate

inline boolean reevaluate()

Return: Whether the book info changed based on the re-evaluation.

Re-evaluate the price level. This would be performed after the status of sources and/or subsources of an “aggregated order book” (i.e., a book built from multiple sources) have changed.

function getEntryAtPosition

inline MamdaOrderBookEntry getEntryAtPosition(
    long pos
)

Parameters:

  • pos The position of the order book entry.

Return: The order book entry or NULL if not found.

Return the order book entry at position “pos” in the price level.

function getEntryPositionInPriceLevel

inline long getEntryPositionInPriceLevel(
    String entryId
)

Parameters:

  • entryId The position of the order book entry.

Return: The position of the Entry in the Price Level. Indexed from 1.

Return the position of an Entry within the Price Level.

function findOrCreateEntry

inline MamdaOrderBookEntry findOrCreateEntry(
    String id
)

function findOrCreateEntry

inline MamdaOrderBookEntry findOrCreateEntry(
    String id,
    long entryPosition
)

function findEntry

inline MamdaOrderBookEntry findEntry(
    String id
)

function setStrictChecking

static inline void setStrictChecking(
    boolean strict
)

Enforce strict checking of order book modifications (at the expense of some performance). This setting is automatically updated by MamdaOrderBook::setStrictChecking().

Protected Functions Documentation

function getOrderBook

inline MamdaOrderBook getOrderBook()

function setOrderBook

inline void setOrderBook(
    MamdaOrderBook book
)

Public Attributes Documentation

variable ACTION_ADD

static final char ACTION_ADD = 'A';

variable ACTION_UPDATE

static final char ACTION_UPDATE = 'U';

A new price level.

variable ACTION_DELETE

static final char ACTION_DELETE = 'D';

Updated price level.

variable ACTION_UNKNOWN

static final char ACTION_UNKNOWN = 'Z';

Deleted price level.

variable SIDE_BID

static final char SIDE_BID = 'B';

Unknown action (error).

variable SIDE_ASK

static final char SIDE_ASK = 'A';

Bid (buy) side.

variable SIDE_UNKNOWN

static final char SIDE_UNKNOWN = 'Z';

Ask (sell) side.

variable LEVEL_LIMIT

static final char LEVEL_LIMIT = 'L';

Unknown side (error).

variable LEVEL_MARKET

static final char LEVEL_MARKET = 'M';

LIMIT order

variable LEVEL_UNKNOWN

static final char LEVEL_UNKNOWN = 'U';

MARKET order


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