{"record":{"id":"80fedba265c99071","repo":"nautechsystems/nautilus_trader","slug":"algo-order-type-order-type-requires-a-trigger","errorCode":null,"errorMessage":"Algo order type {order_type:?} requires a trigger price","messagePattern":"Algo order type (.+?) requires a trigger price","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":2272,"sourceCode":"        callback_rate: Option<String>,\n        working_type: Option<BinanceWorkingType>,\n        good_till_date: Option<i64>,\n    ) -> anyhow::Result<OrderStatusReport> {\n        let (symbol, price_precision, size_precision) =\n            self.cached_precisions_by_id(instrument_id)?;\n\n        let binance_side = BinanceSide::try_from(order_side)?;\n        let binance_order_type = order_type_to_binance_futures(order_type)?;\n        let binance_tif = BinanceTimeInForce::try_from(time_in_force)?;\n\n        let requires_trigger_price = matches!(\n            order_type,\n            OrderType::StopMarket\n                | OrderType::StopLimit\n                | OrderType::MarketIfTouched\n                | OrderType::LimitIfTouched\n        );\n        anyhow::ensure!(\n            !requires_trigger_price || trigger_price.is_some(),\n            \"Algo order type {order_type:?} requires a trigger price\"\n        );\n\n        // Limit orders require time in force\n        let requires_time_in_force =\n            matches!(order_type, OrderType::StopLimit | OrderType::LimitIfTouched);\n\n        let price_str = price.map(|p| p.to_string());\n        let trigger_price_str = if matches!(order_type, OrderType::TrailingStopMarket) {\n            None\n        } else {\n            trigger_price.map(|p| p.to_string())\n        };\n        let reduce_only = reduce_only_param(reduce_only, position_side);\n        let client_id_str = encode_broker_id(&client_order_id, BINANCE_NAUTILUS_FUTURES_BROKER_ID);\n\n        // closePosition is mutually exclusive with quantity and reduceOnly","sourceCodeStart":2254,"sourceCodeEnd":2290,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/client.rs#L2254-L2290","documentation":"Algo-style order types on Binance futures (`StopMarket`, `StopLimit`, `MarketIfTouched`, `LimitIfTouched`) are trigger-based and require a `stopPrice`/trigger price. The HTTP client builds the order request and, when `requires_trigger_price` is true but `trigger_price` is `None`, `anyhow::ensure!` fails with this message.","triggerScenarios":"Calling the futures HTTP order-submission path with `order_type` in {StopMarket, StopLimit, MarketIfTouched, LimitIfTouched} and `trigger_price: None` — e.g. an execution layer that omitted the trigger for a conditional order, or a None propagated from an optional price field.","commonSituations":"Order built via a factory without trigger price then cast to a stop type; migrating code from plain Market to StopMarket without adding a trigger; deserialized order definitions with missing trigger fields.","solutions":["Provide a `Price` for `trigger_price` when submitting StopMarket/StopLimit/MarketIfTouched/LimitIfTouched orders.","Verify upstream parsing so the trigger price is not dropped/None (e.g. missing column in config/backtest data).","If a non-trigger order was intended, use `Market` or `Limit` instead.","Run the caller-side validation that mirrors this check before submission."],"exampleFix":"// before\nclient.submit_order(symbol, side, OrderType::StopMarket, qty, None /* trigger */)\n// after\nclient.submit_order(symbol, side, OrderType::StopMarket, qty, Some(Price::from(\"42000.0\")))","handlingStrategy":"validation","validationCode":"fn ensure_trigger(order_type: OrderType, trigger: Option<Price>) -> Result<(), String> {\n    let requires = matches!(order_type,\n        OrderType::StopMarket | OrderType::StopLimit\n        | OrderType::MarketIfTouched | OrderType::LimitIfTouched);\n    if requires && trigger.is_none() {\n        return Err(format!(\"{order_type:?} requires a trigger price\"));\n    }\n    Ok(())\n}","typeGuard":"fn requires_trigger(t: OrderType) -> bool {\n    matches!(t, OrderType::StopMarket | OrderType::StopLimit\n        | OrderType::MarketIfTouched | OrderType::LimitIfTouched)\n}","tryCatchPattern":"match client.submit_order(...).await {\n    Err(e) if e.to_string().contains(\"requires a trigger price\") => {\n        // supply trigger price or downgrade to Market/Limit and retry\n    }\n    other => other?,\n}","preventionTips":["Always set trigger_price when creating conditional order types.","Check deserialization/config so trigger prices are not silently None.","Use OrderFactory methods that enforce trigger prices for stop/MT types."],"tags":["binance","trigger-price","order-validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}