{"record":{"id":"8c68e58c9764d6a2","repo":"nautechsystems/nautilus_trader","slug":"trailingoffsettype-trailing-offset-type-not-cu","errorCode":null,"errorMessage":"`TrailingOffsetType` {trailing_offset_type} not currently supported","messagePattern":"`TrailingOffsetType` (.+?) not currently supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/trailing.rs","lineNumber":110,"sourceCode":"            }\n            _ => None,\n        }\n    };\n\n    let better_trigger: fn(Price, Price) -> bool = match order_side {\n        OrderSide::Buy => |c, p| c < p,\n        OrderSide::Sell => |c, p| c > p,\n    };\n    let better_limit = better_trigger;\n\n    let compute = |off: Decimal, basis: Price| -> anyhow::Result<Price> {\n        let basis = basis.as_decimal();\n        let offset = match trailing_offset_type {\n            TrailingOffsetType::Price => off,\n            TrailingOffsetType::BasisPoints => basis * off / Decimal::from(10_000),\n            TrailingOffsetType::Ticks => off * price_increment.as_decimal(),\n            _ => {\n                anyhow::bail!(\"`TrailingOffsetType` {trailing_offset_type} not currently supported\")\n            }\n        };\n        let value = match order_side {\n            OrderSide::Buy => basis + offset,\n            OrderSide::Sell => basis - offset,\n        };\n        Price::from_decimal_dp(value, price_increment.precision).map_err(Into::into)\n    };\n\n    match trigger_type {\n        TriggerType::LastPrice | TriggerType::MarkPrice => {\n            let last = last.ok_or(OrderError::InvalidStateTransition)?;\n            let cand_trigger = compute(trailing_offset, last)?;\n            new_trigger_price = maybe_move(&mut trigger_price, cand_trigger, better_trigger);\n\n            if order_type == OrderType::TrailingStopLimit {\n                let limit_offset = order.limit_offset().ok_or_else(|| {\n                    anyhow::anyhow!(\"Missing `limit_offset` for trailing stop limit calculation\")","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/trailing.rs#L92-L128","documentation":"In trailing_stop_calculate the offset computation match handles only TrailingOffsetType::Price, BasisPoints, and Ticks; any other TrailingOffsetType falls into the catch-all `_` arm which bails. The library has no offset conversion defined for that variant.","triggerScenarios":"Passing a trailing_offset_type other than Price/BasisPoints/Ticks (e.g. Percentage or BasisPointsPerSecond, depending on the enum) into trailing_stop_calculate via update_trailing_stop_order.","commonSituations":"Strategy config constructed a TrailingOffsetType variant not yet implemented in the Rust executor; config deserialized an unsupported variant from a template meant for the Python v1 engine.","solutions":["Use TrailingOffsetType::Price, BasisPoints, or Ticks for the order's trailing offset.","Add a conversion arm for the desired TrailingOffsetType in trailing.rs if support is required.","Convert the unsupported offset into a supported unit (e.g. precompute a fixed Price offset) before submitting."],"exampleFix":"// before\nlet order = factory.trailing_stop_market(TrailingOffsetType::Percentage, ...);\n// after\nlet order = factory.trailing_stop_market(TrailingOffsetType::BasisPoints, ...);","handlingStrategy":"validation","validationCode":"fn offset_supported(t: TrailingOffsetType) -> bool {\n    matches!(t, TrailingOffsetType::Price | TrailingOffsetType::BasisPoints | TrailingOffsetType::Ticks)\n}","typeGuard":"fn is_supported_offset(t: &TrailingOffsetType) -> bool {\n    matches!(t, TrailingOffsetType::Price | TrailingOffsetType::BasisPoints | TrailingOffsetType::Ticks)\n}","tryCatchPattern":null,"preventionTips":["Validate strategy config offset types at startup, before order creation.","Keep enum variants used in config aligned with what the Rust executor implements.","Write a unit test per TrailingOffsetType you intend to use in production."],"tags":["trailing-stop","offset-type","unsupported","rust"],"backgroundTag":"unsupported-enum-value","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"}