{"record":{"id":"577984fd78b108df","repo":"nautechsystems/nautilus_trader","slug":"handle-delta-impl-err","errorCode":null,"errorMessage":"`handle_delta` {IMPL_ERR} `{}`","messagePattern":"`handle_delta` (.+?) `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/indicators/src/indicator.rs","lineNumber":36,"sourceCode":"use std::fmt::Debug;\n\nuse nautilus_model::{\n    data::{Bar, OrderBookDelta, OrderBookDeltas, OrderBookDepth10, QuoteTick, TradeTick},\n    orderbook::OrderBook,\n};\n\nconst IMPL_ERR: &str = \"is not implemented for\";\n\n#[allow(unused_variables)]\npub trait Indicator {\n    fn name(&self) -> String;\n\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    ///","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/indicators/src/indicator.rs#L18-L54","documentation":"This panic comes from the default implementation of `Indicator::handle_delta` in crates/indicators/src/indicator.rs. The default is intentionally a `panic!` placeholder: an indicator that receives an `OrderBookDelta` but does not override `handle_delta` signals a programming error, since the indicator was never designed to consume that data type. IMPL_ERR expands to \"is not implemented for\", so the message reads \"`handle_delta` is not implemented for `<indicator name>`\".","triggerScenarios":"Calling `handle_delta(&OrderBookDelta)` on any custom or built-in indicator whose trait impl does not override `handle_delta`. For example, feeding a book-delta stream into a moving-average indicator that only implements `handle_quote`/`handle_trade`, or a data pipeline that routes `OrderBookDelta` events to all subscribed indicators indiscriminately.","commonSituations":"Subscribing an indicator to the wrong data type (L2/L3 delta stream instead of quotes or trades); wiring an actor/data engine to pass book events to a generic indicator list; writing a custom Indicator impl and forgetting to override `handle_delta` while the engine still dispatches deltas.","solutions":["Do not feed OrderBookDelta data to this indicator; route quote ticks (handle_quote) or trade ticks (handle_trade) instead.","If the indicator must consume deltas, override `fn handle_delta(&mut self, delta: &OrderBookDelta)` in your Indicator impl with real logic.","Check the indicator name in the panic message to identify which component was mis-subscribed, and fix the subscription/data-type wiring."],"exampleFix":"// before\nstruct MyMA;\nimpl Indicator for MyMA { /* no handle_delta override, but receives deltas */ }\n\n// after\nimpl Indicator for MyMA {\n    fn handle_delta(&mut self, delta: &OrderBookDelta) {\n        // convert delta to a mid/price update and feed internal state\n    }\n}\n// or: unsubscribe MyMA from the delta stream and subscribe it to quotes","handlingStrategy":"type-guard","validationCode":"// route by capability before dispatch\nif let Some(_delta) = data.as_order_book_delta() {\n    assert!(indicator_supports_deltas(&indicator), \"{} does not handle deltas\", indicator.name());\n}","typeGuard":"fn supports_deltas<I: Indicator>(ind: &I) -> bool { /* true only for impls overriding handle_delta; track via a capability flag */ false }","tryCatchPattern":"// panics cannot be caught idiomatically in Rust; ensure the call site never invokes handle_delta on non-delta indicators\nif indicator_is_delta_capable(ind) { ind.handle_delta(delta); }","preventionTips":["Match indicator subscriptions to data types they implement handlers for.","When writing a custom Indicator, override every handler your data engine may call.","Cover the data-dispatch path with a test that feeds each data type to each indicator."],"tags":["rust","panic","indicators","missing-override","order-book-delta"],"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-14T00:17:10.932Z"}