class com::wombat::mamda::orderbook::MamdaOrderBook;
MamdaOrderBook is a class that provides order book functionality, including iterators over price levels and entries within price levels.
An order book may be read only or writeable. Copying into a read only book is faster than creating a writeable book. Calling methods that attempt to edit the book structure on a read only book will throw a MamdaOrderBookException.
inline MamdaOrderBook()
Construct a new order book object. Contains no price levels upon construction. This book will be writeable.
inline MamdaOrderBook(
MamdaOrderBook copy
)
Parameters:
Construct a copy of the supplied orderbook.
inline MamdaOrderBook(
MamdaOrderBook copy,
boolean writeable
)
Parameters:
Construct a copy of the supplied orderbook.
inline boolean isReadOnly()
Return: true if this book is read only.
If this book is read only.
inline void clear()
Clear all levels from the order book. Clears both the bid and ask side levels from the order book.
inline void setSymbol(
String symbol
)
Parameters:
The order book subscription symbol.
inline String getSymbol()
Return: the symbol.
The order book subscription symbol.
inline void setPartId(
String PartId
)
inline String getPartId()
inline boolean hasPartId()
inline MamdaOrderBookPriceLevel findOrCreateLevel(
double price,
char side
)
Parameters:
Exceptions:
Return: The found or newly create price level.
Create a price level in the orderbook for the given price/size. The price level is initially empty and marked as “not used”. The “not used” status changes automatically when entries are added to the price level.
inline MamdaOrderBookPriceLevel findLevel(
double price,
char side
)
inline MamdaOrderBookPriceLevel getMarketOrdersSide(
char side
)
inline MamdaOrderBookPriceLevel getOrCreateMarketOrdersSide(
char side
)
inline void apply(
MamdaOrderBook deltaBook
)
Parameters:
Exceptions:
Apply a delta to this (presumably) full book.
inline void apply(
MamdaOrderBookBasicDelta delta
)
Parameters:
Exceptions:
Apply a [MamdaOrderBookBasicDelta](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookBasicDelta.html)
to this book.
inline void apply(
MamdaBookAtomicLevel level
)
inline void apply(
MamdaBookAtomicLevelEntry levelEntry
)
inline void apply(
MamdaOrderBookBasicDeltaList deltaList
)
Parameters:
Exceptions:
Apply a [MamdaOrderBookBasicDeltaList](classcom_1_1wombat_1_1mamda_1_1orderbook_1_1MamdaOrderBookBasicDeltaList.html)
to this book.
inline void copy(
MamdaOrderBook book
)
Parameters:
Make a writeable deep copy of a book.
inline void copyReadOnly(
MamdaOrderBook book
)
Parameters:
Make a read only deep copy of a book. This method is faster than the copy (MamdaOrderBook book) method.
inline void setAsDeltaDeleted(
MamdaOrderBook bookToDelete
)
Parameters:
Exceptions:
Set this order book to be a delta that would, when applied, delete all of the fields in the bookToDelete.
inline void setAsDeltaDifference(
MamdaOrderBook lhs,
MamdaOrderBook rhs
)
Parameters:
Exceptions:
Set this order book to be a delta that would, when applied, be the difference between to other books.
inline long getTotalNumLevels()
Return: The total number of level in the order book.
Get the total number of price levels (both sides of order book).
inline int getNumBidLevels()
Return: the number of bid levels.
Get the number of bid levels.
inline int getNumAskLevels()
Return: the number of ask levels.
Get the number of ask levels.
inline MamdaOrderBookPriceLevel getBidMarketOrders()
inline MamdaOrderBookPriceLevel getAskMarketOrders()
inline MamaDateTime getBookTime()
Return: return the book time.
Return the book time.
inline void setBookTime(
MamaDateTime value
)
Parameters:
Set The SourceDerivative for this book.
inline void setSourceDerivative(
MamaSourceDerivative value
)
Parameters:
Set The SourceDerivative for this book.
inline MamaSourceDerivative getSourceDerivative()
Return: the SourceDerivative.
Return the SourceDerivative for this book.
inline MamaSource getSource()
Return: The source.
Get the MamaSource for this order book.
inline void setQuality(
short quality
)
Parameters:
Set the mamaQuality for this order book.
inline short getQuality()
Return: The quality.
Get the mamaQuality for this order book.
inline void setClosure(
Object closure
)
Parameters:
Set the order book closure handle.
inline Object getClosure()
Return: The orderbook closure.
Get the order book closure handle.
inline int hashCode()
inline boolean equals(
Object obj
)
inline void addEntry(
MamdaOrderBookEntry entry,
double price,
char side,
MamaDateTime eventTime,
MamdaOrderBookBasicDelta delta
)
Parameters:
Exceptions:
Add an entry to the order book and (if “delta” is not NULL) record information about the delta related to this action.
inline MamdaOrderBookEntry addEntry(
String entryId,
long entrySize,
double price,
char side,
MamaDateTime eventTime,
MamaSourceDerivative source,
MamdaOrderBookBasicDelta delta
)
Parameters:
Exceptions:
Return: the new entry.
Add an entry to the order book and (if “delta” is not NULL) record information about the delta related to this action. The new entry is returned.
inline void addLevel(
MamdaOrderBookPriceLevel level
)
Parameters:
Add a price level to the orderbook.
inline void updateLevel(
MamdaOrderBookPriceLevel level
)
Parameters:
Exceptions:
Update an existing level in the orderbook.
inline boolean populateDelta(
MamaMsg msg
)
Parameters:
Populate a MamaMsg of the changes to this order book. This will include the changes from the last time this function was called or all changes from the initial state.
inline void populateRecap(
MamaMsg msg
)
Parameters:
Populate a MamaMsg with the current state of this order book.
inline void deleteLevel(
MamdaOrderBookPriceLevel level
)
Parameters:
Exceptions:
Delete a price level from the orderbook.
inline boolean reevaluate()
Exceptions:
Return: Whether the book info changed based on the re-evaluation.
Re-evaluate the order book. 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.
inline void setNeedsReevaluation(
boolean need
)
Parameters:
Set whether this book needs a re-evaluation.
inline boolean getNeedsReevaluation()
Return: true if the book needs re-evaluation.
Get whether this book needs a re-evaluation.
inline void setCheckSourceState(
boolean check
)
Parameters:
Set whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.
inline boolean getCheckSourceState()
Return: true if checking the MamaSourceState
Get whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.
inline MamdaOrderBookPriceLevel getLevelAtPrice(
double price,
char side
)
Parameters:
Return: The order book price level or NULL if not found.
Return the order book price level at “price” on “side” of the order book.
inline MamdaOrderBookPriceLevel getLevelAtPosition(
long pos,
char side
)
Parameters:
Return: The order book price level or NULL if not found.
Return the order book price level at position “pos” in the order book.
inline MamdaOrderBookEntry getEntryAtPosition(
long pos,
char side
)
Parameters:
Return: The order book entry or NULL if not found.
Return the order book entry at position “pos” in the order book.
inline void assertEqual(
MamdaOrderBook rhs
)
Parameters:
Exceptions:
Order book equality verification. A MamdaOrderBookException is thrown if the books are not equal, along with the reason for the inequality.
inline void assertEqual(
MamdaOrderBookPriceLevel lhsLevel,
MamdaOrderBookPriceLevel rhsLevel
)
Parameters:
Exceptions:
Order book level equality verification. A MamdaOrderBookException is thrown if the books are not equal, along with the reason for the inequality.
inline void setIsConsistent(
boolean isConsistent
)
Parameters:
Set whether the order book is in a consistent or an an inconsistent state.
inline boolean getIsConsistent()
Return: boolean Whether the book is in a consistent state.
Get whether the order book is in a consistent or an an inconsistent state. The orderbook will be marked as inconsistent if a gap is detected by the Listener. The book will be marked consistent again once a full recap for the book has been obtained from the feed.
inline void dump()
Dump the order book to standard out.
inline void dump(
OutputStream outputStream
)
Parameters:
OutputStream
Dump the order book to an OutputStream
.
inline void updateEntry(
MamdaOrderBookEntry entry,
double size,
MamaDateTime eventTime,
MamdaOrderBookBasicDelta delta
)
Parameters:
Exceptions:
Update an entry in the order book and (if “delta” is not NULL) record information about the delta related to this action. If the entry is not internally “wired” to the order book, a MamdaOrderBookInvalidEntry exception is thrown.
inline void deleteEntry(
MamdaOrderBookEntry entry,
MamaDateTime eventTime,
MamdaOrderBookBasicDelta delta
)
Parameters:
Exceptions:
Delete an entry in the order book and (if “delta” is not NULL) record information about the delta related to this action. If the entry is not internally “wired” to the order book, a MamdaOrderBookInvalidEntry exception is thrown.
inline void addEntriesFromBook(
MamdaOrderBook book,
MamdaOrderBookEntryFilter filter,
MamdaOrderBookBasicDeltaList delta
)
Parameters:
Exceptions:
Add all entries from another book into this book.
inline void addPriceLevelsFromBookAsEntries(
MamdaOrderBook book,
String source,
MamdaOrderBookBasicDeltaList delta
)
Parameters:
Exceptions:
Add all price levels from another book as entries (one per price level) into this book using “source” as the entryId for each entry.
inline void deleteEntriesFromSource(
MamaSource source,
MamdaOrderBookBasicDeltaList delta
)
Parameters:
Exceptions:
Delete all entries in this book that have “source” as its MamaSource.
inline void generateDeltaMsgs(
boolean publish
)
Parameters:
Enable the generation of book deltas for this book. When delta generation is enabled changes to the book are saved and can be popultaed to MamaMsgs.
inline boolean getGenerateDeltaMsgs()
Return: Whether book delta generation is enabled.
Get whether book delta generation is enabled
inline void clearDeltaList()
clear the delta list using for storing generated deltas
inline void addDelta(
MamdaOrderBookEntry entry,
MamdaOrderBookPriceLevel level,
double plDeltaSize,
char plAction,
char entryAction
)
Parameters:
For book delta generation. Add a delta to the order book delta list for the publishing of order book data
inline void detach(
MamdaOrderBookEntry entry
)
Parameters:
NOOP FOR JAVA Adds the entry to the list of entries to be detached.
inline void detach(
MamdaOrderBookPriceLevel level
)
Parameters:
Exceptions:
Detach a price level.
inline Iterator bidEntryIterator()
Return: the iterator.
Iterator for all the bid side entries in the book.
inline Iterator bidIterator()
Return: Iterator java.util.Iterator for the bid side price levels in the order book.
Allows an application to iterate over all the bid side price levels in the order book.
inline Iterator askIterator()
Return: Iterator java.util.Iterator for the ask side price levels in the order book.
Allows an application to iterate over all ask side price levels in the order book.
inline Iterator askEntryIterator()
Return: the iterator.
Iterator for all the ask side entries in the book.
inline void cleanupDetached()
static inline void setStrictChecking(
boolean strict
)
Parameters:
Enforce strict checking of order book modifications (at the expense of some performance). This setting is passed on to the MamdaOrderBookPriceLevel and MamdaOrderBookEntry classes.
Updated on 2023-03-31 at 15:30:38 +0100