Package velox.api.layer1.layers.utils
Class OrderBook
java.lang.Object
velox.api.layer1.layers.utils.OrderBook
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Beware: changing this map will break order bookintintBeware: changing this map will break order bookintgetFirstKeyOrNone(TreeMap<Integer, Long> map) longintgetLastKeyOrNone(TreeMap<Integer, Long> map) doublelonggetSizeFor(boolean isBid, int price) longgetSizeFor(boolean isBid, int price, long defaultSize) intintbooleanisEmpty()Check if order book is emptyInteger[]levels(boolean isBid) levels(boolean isBid, int from, boolean fromInclusive, int to, boolean toInclusive) levels(boolean isBid, int from, int to) voidonUpdate(boolean isBid, int price, long size) voidonUpdate(DepthAggregationEvent depthAggregationEvent) toString()protected void
-
Field Details
-
NONE
public static final int NONE- See Also:
-
bidMap
-
askMap
-
-
Constructor Details
-
OrderBook
public OrderBook() -
OrderBook
-
-
Method Details
-
onUpdate
public void onUpdate(boolean isBid, int price, long size) -
onUpdate
-
updateMap
-
getBestBidPriceOrNone
public int getBestBidPriceOrNone() -
getBestAskPriceOrNone
public int getBestAskPriceOrNone() -
getMidPriceOrNan
public double getMidPriceOrNan() -
getFirstKeyOrNone
-
getFirstValueOrNone
-
levels
-
getWorstBidPriceOrNone
public int getWorstBidPriceOrNone() -
getWorstAskPriceOrNone
public int getWorstAskPriceOrNone() -
getLastKeyOrNone
-
levels
-
levels
-
getSizeFor
public long getSizeFor(boolean isBid, int price) -
getSizeFor
public long getSizeFor(boolean isBid, int price, long defaultSize) -
clear
public void clear() -
getBidMap
Beware: changing this map will break order book -
getAskMap
Beware: changing this map will break order book -
isEmpty
public boolean isEmpty()Check if order book is empty- Returns:
- true if both sides of the book are empty, false otherwise
-
toString
-