{"record":{"id":"429d8c9de4276757","repo":"nautechsystems/nautilus_trader","slug":"orders-do-not-have-a-stop-trigger-price","errorCode":null,"errorMessage":"{} orders do not have a STOP trigger price","messagePattern":"(.+?) orders do not have a STOP trigger price","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/trading/src/strategy/mod.rs","lineNumber":383,"sourceCode":"        let mut updating = false;\n\n        if quantity.is_some_and(|q| q != order.quantity() || order.is_pending_update()) {\n            updating = true;\n        }\n\n        if let Some(price) = price {\n            if !LIMIT_ORDER_TYPES.contains(&order.order_type()) {\n                anyhow::bail!(\"{} orders do not have a LIMIT price\", order.order_type());\n            }\n\n            if Some(price) != order.price() {\n                updating = true;\n            }\n        }\n\n        if let Some(trigger_price) = trigger_price {\n            if !STOP_ORDER_TYPES.contains(&order.order_type()) {\n                anyhow::bail!(\n                    \"{} orders do not have a STOP trigger price\",\n                    order.order_type()\n                );\n            }\n\n            if Some(trigger_price) != order.trigger_price() {\n                updating = true;\n            }\n        }\n\n        if !updating {\n            log::error!(\n                \"Cannot create command ModifyOrder: quantity, price, and trigger were either None \\\n                or the same as existing values\"\n            );\n            return Ok(());\n        }\n","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/trading/src/strategy/mod.rs#L365-L401","documentation":"modify_orders was given a trigger_price argument for an order whose type is not in STOP_ORDER_TYPES. Only stop-type orders (STOP, STOP_LIMIT, TRAILING variants) carry a trigger price, so passing trigger_price for e.g. a LIMIT or MARKET order bails naming the order type.","triggerScenarios":"Calling strategy.modify_order/modify_orders with trigger_price=Some(...) on a LIMIT, MARKET, or other non-stop order type.","commonSituations":"A generic amend helper that always passes both price and trigger_price; confusing limit price with trigger price when modifying LIMIT orders; bulk updates applied to mixed open-order portfolios.","solutions":["Pass trigger_price only for STOP-type orders; use price for LIMIT-type orders.","Check the order type via cache.order(client_order_id).order_type before choosing which field to amend.","Omit trigger_price (pass None) for orders that have no trigger concept."],"exampleFix":"// before\nself.modify_order(order, price=px, trigger_price=tp)  # order is LIMIT\n\n// after\nif order.order_type in (OrderType.STOP, OrderType.STOP_LIMIT, OrderType.TRAILING_STOP, OrderType.TRAILING_STOP_LIMIT):\n    self.modify_order(order, trigger_price=tp)\nelse:\n    self.modify_order(order, price=px)","handlingStrategy":"type-guard","validationCode":"STOP_TYPES = {OrderType.STOP, OrderType.STOP_LIMIT, OrderType.TRAILING_STOP, OrderType.TRAILING_STOP_LIMIT}\nif trigger_price is not None and order.order_type not in STOP_TYPES:\n    raise TypeError(f\"{order.order_type} orders do not accept a trigger price\")","typeGuard":"def accepts_trigger_price(order) -> bool:\n    return order.order_type in {OrderType.STOP, OrderType.STOP_LIMIT, OrderType.TRAILING_STOP, OrderType.TRAILING_STOP_LIMIT}","tryCatchPattern":"try:\n    self.modify_order(order, trigger_price=new_trigger)\nexcept RuntimeError as e:\n    if \"do not have a STOP trigger price\" in str(e):\n        self.log.error(\"use price for limit-type orders\")\n    else:\n        raise","preventionTips":["Only amend trigger_price on stop-type orders; check order.order_type first","Do not blindly pass both price and trigger_price in generic amend wrappers","Keep a shared ORDER_TYPE→amendable-fields map used by all modify helpers"],"tags":["rust","strategy","modify-order","order-type","trigger-price"],"backgroundTag":"invalid-argument-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"}