{"record":{"id":"27a3c9e5a8655e6e","repo":"nautechsystems/nautilus_trader","slug":"handle-book-mbo-impl-err","errorCode":null,"errorMessage":"`handle_book_mbo` {IMPL_ERR} `{}`","messagePattern":"`handle_book_mbo` (.+?) `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/indicators/src/indicator.rs","lineNumber":48,"sourceCode":"\n    fn has_inputs(&self) -> bool;\n\n    fn initialized(&self) -> bool;\n\n    fn handle_delta(&mut self, delta: &OrderBookDelta) {\n        panic!(\"`handle_delta` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_deltas(&mut self, deltas: &OrderBookDeltas) {\n        panic!(\"`handle_deltas` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_depth(&mut self, depth: &OrderBookDepth10) {\n        panic!(\"`handle_depth` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_book(&mut self, book: &OrderBook) {\n        panic!(\"`handle_book_mbo` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    /// Updates the indicator with the given quote tick.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the configured price type cannot be extracted from the quote.\n    fn handle_quote(&mut self, quote: &QuoteTick) -> anyhow::Result<()> {\n        anyhow::bail!(\"`handle_quote_tick` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_trade(&mut self, trade: &TradeTick) {\n        panic!(\"`handle_trade_tick` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_bar(&mut self, bar: &Bar) {\n        panic!(\"`handle_bar` {IMPL_ERR} `{}`\", self.name());\n    }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/indicators/src/indicator.rs#L30-L66","documentation":"Default `Indicator::handle_book` panics when an indicator receives an MBO `OrderBook` object without overriding `handle_book`. Note the message string itself says \"`handle_book_mbo` is not implemented for ...\" (a known label inconsistency in the source): the method name is `handle_book` but the panic text references the MBO handler name. Either way, the default body is a guard: MBO (market-by-order) book input requires a dedicated override.","triggerScenarios":"Calling `handle_book(&OrderBook)` on an indicator lacking an override — typically when MBO market data (e.g. from venues that publish market-by-order) is routed to an indicator implemented for quotes, trades, or deltas only.","commonSituations":"Subscribing indicators to MBO data feeds (DepthMarketData like Databento MBO); venue/data-source changes switching the book representation to MBO without updating indicator implementations; generic dispatch code that calls handle_book on every indicator in a registry.","solutions":["Override `fn handle_book(&mut self, book: &OrderBook)` in the indicator impl to process the MBO book.","Convert MBO books to a supported representation (e.g. deltas or depth) before passing to the indicator.","Only register the indicator with data sources whose book type it actually implements."],"exampleFix":"// before\n// MBO OrderBook routed to indicator without handle_book\n\n// after\nimpl Indicator for MyIndicator {\n    fn handle_book(&mut self, book: &OrderBook) {\n        // derive price/volume state from the MBO book\n    }\n}","handlingStrategy":"validation","validationCode":"// ensure MBO sources are only wired to MBO-capable indicators\nif book.is_mbo() && !ind.handles_mbo() { log::error!(\"{} cannot consume MBO book\", ind.name()); return; }","typeGuard":null,"tryCatchPattern":"// guard the dispatch: if mbo_capable(ind) { ind.handle_book(book); } else { convert_book_to_deltas(book, &mut ind); }","preventionTips":["Only subscribe MBO data (e.g. Databento MBO) when indicators implement handle_book.","Centralize book-type conversion (MBO -> deltas/depth) in one adapter.","Note the message says handle_book_mbo though the method is handle_book — search for both names when diagnosing."],"tags":["rust","panic","indicators","mbo","missing-override","order-book"],"backgroundTag":"method-not-implemented","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}