Interface IL2OrderBook<A, L>
A Level-2 (market-by-price) order book: aggregated price levels per side.
A is the depth (size) amount type and
L the level (price) amount type.
public interface IL2OrderBook<A, L> : IOrderBook where A : IFixedPointAmount where L : IFixedPointAmount
Type Parameters
AL
Remarks
The two dimensions carry independent, fixed scales: LevelBase/LevelPrecision for prices and DepthBase/DepthPrecision for sizes. They need not match (a book quoted in ticks to 2 decimal places may size in lots to 6), and values are never compared across the two dimensions.
Enumeration is best-first: bids highest price first, asks lowest price first.
Properties
AsksAscending
Ask levels, lowest price first.
IReadOnlyList<(L Price, A Size)> AsksAscending { get; }
Property Value
- IReadOnlyList<(L Price, A Size)>
BidsDescending
Bid levels, highest price first.
IReadOnlyList<(L Price, A Size)> BidsDescending { get; }
Property Value
- IReadOnlyList<(L Price, A Size)>
DepthBase
Base of the size (depth) dimension.
int DepthBase { get; }
Property Value
DepthPrecision
Precision of the size (depth) dimension.
int DepthPrecision { get; }
Property Value
LevelBase
Base of the price (level) dimension.
int LevelBase { get; }
Property Value
LevelPrecision
Precision of the price (level) dimension.
int LevelPrecision { get; }
Property Value
Methods
TryGetAsk(L, out A)
Look up the aggregate size at an ask price.
bool TryGetAsk(L price, out A size)
Parameters
priceLPrice at the book's level scale.
sizeAThe level's aggregate size when present.
Returns
TryGetBid(L, out A)
Look up the aggregate size at a bid price.
bool TryGetBid(L price, out A size)
Parameters
priceLPrice at the book's level scale.
sizeAThe level's aggregate size when present.