diff --git a/lib/traders/ib.js b/lib/traders/ib.js index 1694f9a3..6b3097e2 100644 --- a/lib/traders/ib.js +++ b/lib/traders/ib.js @@ -630,7 +630,7 @@ class MarketDepthDatum extends TraderDatum { const bookSide = side === 1 ? orderbook.bids : orderbook.asks; - if (operation === 2) { + if (operation === 2 || size === 0) { bookSide.delete(position); } else { const roundLot = this.#roundLots.get(symbol) ?? 100;