public void FindSizeAndPrice(BuyPosition position) { HeapifyUnsafe(heap => { //if quote is Zero, then it will b remove from Quote Heap //and our heap will be reheapfied return(heap.Remove(quote => { quote.AdjustBuyPosition(position); return quote.Invalid; })); }); }
public void AdjustBuyPosition(BuyPosition position) { if (position.AdjustWithQuote(this, _quoteTrader) >= QuoteSize) { //we reduce the unit ONLY if the buy position can //completely settle it //becoz the my trade is either going to consume it on the //XCHG thus, it would disappear else someone already //consumed it, thus DONE notif is anyway on its way in both cases //if my trade is partially consuming it and I modify the quantity //then I have to take extra precautions on notification when adjusting its size //let the notif do its work. _totalSize = 0; } }