Classes Files

Wombat::MamdaOrderBookPriceLevel

Inherits from IEnumerable

Public Types

  Name
enum class sbyte Actions { Add = (sbyte)’A’, Update = (sbyte)’U’, Delete = (sbyte)’D’, Unknown = (sbyte)’Z’}
An enumeration for book price level actions. Price level actions differ from entry actions because, for example, a price level message with Actions.Add may consist of entries with Actions.Add, Actions.Update or Actions.Delete.
enum class sbyte Sides { Bid = (sbyte)’B’, Ask = (sbyte)’A’, Unknown = (sbyte)’U’}

Public Functions

  Name
  MamdaOrderBookPriceLevel()
Default constructor.
  MamdaOrderBookPriceLevel(MamdaOrderBookPriceLevel copy)
Construct a price level object which is a shallow copy of the original.
void copy(MamdaOrderBookPriceLevel copy)
Copy a price level object which is an exact and deep copy of the original.
void setPrice(MamaPrice price)
void setSize(long size)
void setSizeChange(long size)
void setNumEntries(int numEntries)
void setSide(Sides side)
void setAction(Actions action)
void setTime(DateTime time)
void setDetails(MamdaOrderBookPriceLevel level)
Take the details from
void addEntry(MamdaOrderBookEntry entry)
Add a new order book entry to the price level.
void updateEntry(MamdaOrderBookEntry entry)
Update the details of an existing entry in the level.
void removeEntry(MamdaOrderBookEntry entry)
Remove an order book entry from the price level. MamdaOrderBookEntry
IEnumerator GetEnumerator()
Returns a
void checkNotExist(MamdaOrderBookEntry entry)
If the provided order book entry exists in the price level a
void markAllDeleted()
Mark everything in this price level as deleted, including entries.
void setAsDifference(MamdaOrderBookPriceLevel lhs, MamdaOrderBookPriceLevel rhs)
MamaPrice getPrice()
Return the price for this level.
long getSize()
Return the total size (across all entries) for this level.
long getSizeChange()
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.
int getNumEntries()
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.
Sides getSide()
Return the side (bid/ask) of the book for this level.
Actions getAction()
Return the action for this price level. All price levels for a full book are marked with mActionADD.
bool hasTime()
DateTime getTime()
Return the time stamp for when the price level was last updated.
void assertEqual(MamdaOrderBookPriceLevel rhs)
Order book price level equality verification. A is thrown if the price levels are not equal, along with the reason for the inequality.
void setStrictChecking(bool strict)
Enforce strict checking of order book modifications (at the expense of some performance). This setting is automatically updated by MamdaOrderBook.setStrictChecking().

Public Types Documentation

enum Actions

Enumerator Value Description
Add (sbyte)’A’ A new price level
Update (sbyte)’U’ Updated price level.
Delete (sbyte)’D’ Deleted price level.
Unknown (sbyte)’Z’ Unknown action (error).

An enumeration for book price level actions. Price level actions differ from entry actions because, for example, a price level message with Actions.Add may consist of entries with Actions.Add, Actions.Update or Actions.Delete.

enum Sides

Enumerator Value Description
Bid (sbyte)’B’ Bid (buy) side.
Ask (sbyte)’A’ Ask (sell) side.
Unknown (sbyte)’U’ Unknown side (error).

Public Functions Documentation

function MamdaOrderBookPriceLevel

MamdaOrderBookPriceLevel()

Default constructor.

function MamdaOrderBookPriceLevel

MamdaOrderBookPriceLevel(
    MamdaOrderBookPriceLevel copy
)

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

Parameters:

function copy

void copy(
    MamdaOrderBookPriceLevel copy
)

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

Parameters:

function setPrice

void setPrice(
    MamaPrice price
)

Parameters:

  • price

function setSize

void setSize(
    long size
)

Parameters:

  • size

function setSizeChange

void setSizeChange(
    long size
)

Parameters:

  • size

function setNumEntries

void setNumEntries(
    int numEntries
)

Parameters:

  • numEntries

function setSide

void setSide(
    Sides side
)

Parameters:

  • side

function setAction

void setAction(
    Actions action
)

Parameters:

  • action

function setTime

void setTime(
    DateTime time
)

Parameters:

  • time

function setDetails

void setDetails(
    MamdaOrderBookPriceLevel level
)

Take the details from

Parameters:

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

levelcode> 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 addEntry

void addEntry(
    MamdaOrderBookEntry entry
)

Add a new order book entry to the price level.

Parameters:

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

function updateEntry

void updateEntry(
    MamdaOrderBookEntry entry
)

Update the details of an existing entry in the level.

Parameters:

  • entry An instance of
MamdaOrderBookEntry

with the new details for the entry in the level.

function removeEntry

void removeEntry(
    MamdaOrderBookEntry entry
)

Remove an order book entry from the price level. MamdaOrderBookEntry

Parameters:

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

function GetEnumerator

IEnumerator GetEnumerator()

Returns a

Return: The enumerator for the price level entries

System.Collections.IEnumerator for all entries within this level. Price Level entries are represented by the [MamdaOrderBookEntry](classWombat_1_1MamdaOrderBookEntry.html) class.

function checkNotExist

void checkNotExist(
    MamdaOrderBookEntry entry
)

If the provided order book entry exists in the price level a

Parameters:

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

Exceptions:

[MamdaOrderBookException](classWombat_1_1MamdaOrderBookException.html) exception is thrown. Otherwise the method simply returns.

function markAllDeleted

void markAllDeleted()

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

function setAsDifference

void setAsDifference(
    MamdaOrderBookPriceLevel lhs,
    MamdaOrderBookPriceLevel rhs
)

Parameters:

  • lhs
  • rhs

function getPrice

MamaPrice getPrice()

Return the price for this level.

Return: The price for this level.

function getSize

long getSize()

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

Return: The total size for this level.

function getSizeChange

long getSizeChange()

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.

Return: The changed size for this level.

function getNumEntries

int getNumEntries()

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.

Return: The actual number of entries for this level.

function getSide

Sides getSide()

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

Return: The side of the book for this level.

function getAction

Actions getAction()

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

Return: The action for this level.

function hasTime

bool hasTime()

Return:

function getTime

DateTime 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

void assertEqual(
    MamdaOrderBookPriceLevel rhs
)

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

Parameters:

  • rhs

Exceptions:

function setStrictChecking

static void setStrictChecking(
    bool strict
)

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

Parameters:

  • strict

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