{"record":{"id":"b7f86bf718d8ec32","repo":"nautechsystems/nautilus_trader","slug":"triggertype-trigger-type-not-currently-support","errorCode":null,"errorMessage":"`TriggerType` {trigger_type} not currently supported","messagePattern":"`TriggerType` (.+?) not currently supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/trailing.rs","lineNumber":176,"sourceCode":"                if updated.is_some() {\n                    new_trigger_price = updated;\n                }\n\n                if order_type == OrderType::TrailingStopLimit {\n                    let limit_offset = order.limit_offset().ok_or_else(|| {\n                        anyhow::anyhow!(\n                            \"Missing `limit_offset` for trailing stop limit calculation\"\n                        )\n                    })?;\n                    let cand_limit = compute(limit_offset, last)?;\n                    let updated = maybe_move(&mut limit_price, cand_limit, better_limit);\n                    if updated.is_some() {\n                        new_limit_price = updated;\n                    }\n                }\n            }\n        }\n        _ => anyhow::bail!(\"`TriggerType` {trigger_type} not currently supported\"),\n    }\n\n    Ok((new_trigger_price, new_limit_price))\n}\n\n/// Calculates the trailing stop price using the last traded price.\n///\n/// # Errors\n///\n/// Returns an error if the offset type is unsupported or the calculated price cannot be\n/// represented as a [`Price`].\npub fn trailing_stop_calculate_with_last(\n    price_increment: Price,\n    trailing_offset_type: TrailingOffsetType,\n    side: OrderSide,\n    offset: Decimal,\n    last: Price,\n) -> anyhow::Result<Price> {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/trailing.rs#L158-L194","documentation":"In trailing_stop_calculate the trigger-type computation match handles only the implemented TriggerType variants and ends with a `_ => bail!` arm. A TriggerType the trailing-stop logic does not implement cannot drive trigger price updates, so the library refuses the calculation.","triggerScenarios":"Calling trailing_stop_calculate for an order whose trigger_type is one of the unsupported variants (e.g. a Bid/Ask/Last variant not covered in the match arms in trailing.rs around line 176).","commonSituations":"Order configured with an exotic trigger type (e.g. inverse-price or cross-venue triggers) that the Rust trailing calculator has not implemented; test with an unsupported trigger type accidentally run against production code paths.","solutions":["Set the order's trigger_type to a variant supported by the trailing calculator (e.g. DefaultTriggerType/Last/Bid/Ask as covered by the match).","Extend the match in trailing.rs to implement the missing TriggerType if needed.","Skip trailing updates for unsupported trigger types in the caller instead of invoking the calculator."],"exampleFix":"// before\nlet order = order_with_trigger_type(TriggerType::InversePrice);\nlet px = trailing_stop_calculate(&order, ...)?;\n// after\nlet order = order_with_trigger_type(TriggerType::Default);\nlet px = trailing_stop_calculate(&order, ...)?;","handlingStrategy":"validation","validationCode":"if !matches!(order.trigger_type(), TriggerType::Default | TriggerType::Last | TriggerType::Bid | TriggerType::Ask) {\n    return Err(anyhow::anyhow!(\"unsupported trigger type for trailing stop\"));\n}","typeGuard":"fn trailing_trigger_supported(t: &TriggerType) -> bool { !matches!(t, TriggerType::InversePrice | _) } // restrict to variants covered by the match","tryCatchPattern":null,"preventionTips":["Pin trigger_type in strategy configs to the supported variants.","Cover trigger_type handling in tests mirroring the match arms in trailing.rs.","Check trailing.rs match arms after adding new TriggerType variants to the enum."],"tags":["trailing-stop","trigger-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"}