nautechsystems/nautilus_trader · error
Cannot modify order in place: {} orders do not have a LIMIT
Error message
Cannot modify order in place: {} orders do not have a LIMIT price What it means
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.
Source
Thrown at crates/trading/src/algorithm/mod.rs:1024
order: &mut OrderAny,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
) -> anyhow::Result<()>
where
Self: ExecutionAlgorithmNative,
{
// Validate order status
let status = order.status();
if status != OrderStatus::Initialized && status != OrderStatus::Released {
anyhow::bail!(
"Cannot modify order in place: status is {status:?}, expected INITIALIZED or RELEASED"
);
}
// Validate order type compatibility
if price.is_some() && order.price().is_none() {
anyhow::bail!(
"Cannot modify order in place: {} orders do not have a LIMIT price",
order.order_type()
);
}
if trigger_price.is_some() && order.trigger_price().is_none() {
anyhow::bail!(
"Cannot modify order in place: {} orders do not have a STOP trigger price",
order.order_type()
);
}
// Check if any value would actually change
let qty_changing = quantity.is_some_and(|q| q != order.quantity());
let price_changing = price.is_some() && price != order.price();
let trigger_changing = trigger_price.is_some() && trigger_price != order.trigger_price();
if !qty_changing && !price_changing && !trigger_changing {View on GitHub (pinned to 18893faf8b)
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()
Example fix
// before
algo.modify_order_in_place(&mut order, None, Some(new_price), None)?;
// after
if order.price().is_some() {
algo.modify_order_in_place(&mut order, None, Some(new_price), None)?;
} Defensive patterns
Strategy: validation
Validate before calling
if price.is_some() && order.price().is_none() { return Err(anyhow!("order type {:?} has no limit price", order.order_type())); } Type guard
fn supports_limit_price(o: &OrderAny) -> bool { o.price().is_some() } Prevention
- Branch on order_type before supplying price
- Never attempt to change an order's type via in-place modification
When it happens
Trigger: Calling modify_order_in_place(order, qty, Some(price), trigger) on a Market, StopMarket, or TrailingStopMarket order.
Common situations: 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.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Cannot modify order in place: status is {status:?}, expected
- Cannot modify order in place: {} orders do not have a STOP t
- {FAILED}: {e}
- {FAILED}: {e}
- {FAILED}: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/860459e449062c1a.
Report an issue: GitHub.