{"record":{"id":"860459e449062c1a","repo":"nautechsystems/nautilus_trader","slug":"cannot-modify-order-in-place-orders-do-not-hav","errorCode":null,"errorMessage":"Cannot modify order in place: {} orders do not have a LIMIT price","messagePattern":"Cannot modify order in place: (.+?) orders do not have a LIMIT price","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/trading/src/algorithm/mod.rs","lineNumber":1024,"sourceCode":"        order: &mut OrderAny,\n        quantity: Option<Quantity>,\n        price: Option<Price>,\n        trigger_price: Option<Price>,\n    ) -> anyhow::Result<()>\n    where\n        Self: ExecutionAlgorithmNative,\n    {\n        // Validate order status\n        let status = order.status();\n        if status != OrderStatus::Initialized && status != OrderStatus::Released {\n            anyhow::bail!(\n                \"Cannot modify order in place: status is {status:?}, expected INITIALIZED or RELEASED\"\n            );\n        }\n\n        // Validate order type compatibility\n        if price.is_some() && order.price().is_none() {\n            anyhow::bail!(\n                \"Cannot modify order in place: {} orders do not have a LIMIT price\",\n                order.order_type()\n            );\n        }\n\n        if trigger_price.is_some() && order.trigger_price().is_none() {\n            anyhow::bail!(\n                \"Cannot modify order in place: {} orders do not have a STOP trigger price\",\n                order.order_type()\n            );\n        }\n\n        // Check if any value would actually change\n        let qty_changing = quantity.is_some_and(|q| q != order.quantity());\n        let price_changing = price.is_some() && price != order.price();\n        let trigger_changing = trigger_price.is_some() && trigger_price != order.trigger_price();\n\n        if !qty_changing && !price_changing && !trigger_changing {","sourceCodeStart":1006,"sourceCodeEnd":1042,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/trading/src/algorithm/mod.rs#L1006-L1042","documentation":"When modifying an order in place with a new price, the order must actually have a LIMIT price field. Orders whose type has no limit price (e.g. MARKET, STOP_MARKET) cannot accept one, so the call bails with the offending order type in the message.","triggerScenarios":"Calling modify_order_in_place(order, qty, Some(price), trigger) on a Market, StopMarket, or TrailingStopMarket order.","commonSituations":"Generic modification code passing prices to all orders; trying to convert a market order to a limit order via in-place modification; misconfigured strategy parameters supplying a price for market-type executions.","solutions":["Only pass price for order types that support limit prices (LIMIT, LIMIT_IF_TOUCHED, STOP_LIMIT)","Check order.price().is_some() before supplying a new price","Create a new order of the correct type if the order type itself must change","Branch modification logic on order.order_type()"],"exampleFix":"// before\nalgo.modify_order_in_place(&mut order, None, Some(new_price), None)?;\n// after\nif order.price().is_some() {\n    algo.modify_order_in_place(&mut order, None, Some(new_price), None)?;\n}","handlingStrategy":"validation","validationCode":"if price.is_some() && order.price().is_none() { return Err(anyhow!(\"order type {:?} has no limit price\", order.order_type())); }","typeGuard":"fn supports_limit_price(o: &OrderAny) -> bool { o.price().is_some() }","tryCatchPattern":null,"preventionTips":["Branch on order_type before supplying price","Never attempt to change an order's type via in-place modification"],"tags":["rust","orders","execution-algorithm"],"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-14T00:17:10.932Z"}