{"record":{"id":"f96a08032e83c5b6","repo":"nautechsystems/nautilus_trader","slug":"trailingoffsettype-is-not-supported","errorCode":null,"errorMessage":"`TrailingOffsetType` {:?} is not supported","messagePattern":"`TrailingOffsetType` (.+?) is not supported","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/transform/policy.rs","lineNumber":87,"sourceCode":"        order.order_type(),\n        NautilusOrderType::TrailingStopMarket | NautilusOrderType::TrailingStopLimit\n    ) {\n        return Ok(());\n    }\n\n    if let Some(trailing_offset) = order.trailing_offset() {\n        let trailing_offset_f64 = trailing_offset.to_string().parse::<f64>().map_err(|e| {\n            anyhow::anyhow!(\"Failed to convert trailing offset {trailing_offset} to f64: {e}\")\n        })?;\n\n        match order.trailing_offset_type() {\n            Some(TrailingOffsetType::BasisPoints) => {\n                ib_order.trailing_percent = Some(trailing_offset_f64 / 100.0);\n            }\n            Some(TrailingOffsetType::Price) | None => {\n                ib_order.aux_price = Some(trailing_offset_f64);\n            }\n            Some(other) => anyhow::bail!(\"`TrailingOffsetType` {:?} is not supported\", other),\n        }\n    }\n\n    if let Some(trigger_price) = order.trigger_price() {\n        let converted_trigger = convert_price(trigger_price, price_magnifier);\n        ib_order.trail_stop_price = Some(converted_trigger);\n        ib_order.trigger_method = order\n            .trigger_type()\n            .map(trigger_type_to_ib_trigger_method)\n            .unwrap_or_default();\n    }\n\n    Ok(())\n}\n\npub(super) fn apply_display_quantity_policy(ib_order: &mut IBOrder, order: &OrderAny) {\n    if let Some(display_qty) = order.display_qty() {\n        ib_order.display_size = Some(display_qty.as_f64() as i32);","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/transform/policy.rs#L69-L105","documentation":"IB trailing-stop orders support only price and percentage trailing offsets (plus basis points mapped to percentage). Any other TrailingOffsetType enum value on a trailing order cannot be mapped to IB fields (trailing_percent / aux_price), so apply_trailing_order_policy bails.","triggerScenarios":"nautilus_order_to_ib_order -> apply_trailing_order_policy with an order having a trailing offset type other than Price, BasisPoints, or None (e.g. TrailingOffsetType::Ticks or BasisPointsPerSecond depending on enum variants), typically on TRAILING_STOP_MARKET orders.","commonSituations":"Strategies configured with tick-based trailing stops (common on crypto/futures venues) submitted to IB, where IB's API has no equivalent field.","solutions":["Change the order's trailing_offset_type to TrailingOffsetType::Price (absolute price offset) or BasisPoints","Convert the tick-based offset to an absolute price offset before creating the order: offset_ticks * instrument.price_increment","Route trailing-stop orders to a venue that supports tick-based trailing offsets instead of IB"],"exampleFix":"// before\norder_factory.trailing_stop_market(side, qty, TrailingOffsetType::Ticks, ...)\n// after\norder_factory.trailing_stop_market(side, qty, TrailingOffsetType::Price, ...) // offset in price units","handlingStrategy":"validation","validationCode":"match order.trailing_offset_type() {\n    None | Some(TrailingOffsetType::Price) | Some(TrailingOffsetType::BasisPoints) => {},\n    Some(other) => return Err(anyhow::anyhow!(\"IBKR does not support trailing offset type {:?}\", other)),\n}","typeGuard":"fn ibkr_supported_trailing_offset(t: TrailingOffsetType) -> bool {\n    matches!(t, TrailingOffsetType::Price | TrailingOffsetType::BasisPoints)\n}","tryCatchPattern":null,"preventionTips":["Configure strategies with Price or BasisPoints trailing offsets when routing to IBKR","Convert tick-based offsets to price offsets using instrument.price_increment before order creation","Centralize venue-specific order validation in one pre-submit guard"],"tags":["interactive-brokers","trailing-stop","enum","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-14T00:17:10.932Z"}