nautechsystems/nautilus_trader · error · anyhow::Error

Order type requires a trigger price

Error message

Order type {order_type:?} requires a trigger price

What it means

Binance Futures order placement validates that certain order types (STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET, TRAILING_STOP_MARKET variants, MARKET_IF_TOUCHED, LIMIT_IF_TOUCHED) must include a trigger price. This client-side guard bails before the HTTP request if trigger_price is None for such an order type.

Solutions

  1. Pass a trigger_price whenever using a trigger-based order type
  2. Validate the stop/trigger price is set in the strategy before calling place_order
  3. Use a plain LIMIT/MARKET type if no trigger is intended

Example fix

// before
client.submit_order(instrument_id, OrderType::StopMarket, side, qty, None /* trigger */)
// after
client.submit_order(instrument_id, OrderType::StopMarket, side, qty, Some(stop_price))
Defensive patterns

Strategy: validation

Validate before calling

let requires_trigger = matches!(order_type, OrderType::StopMarket | OrderType::StopLimit | OrderType::TrailingStopMarket | OrderType::TrailingStopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched);
if requires_trigger && trigger_price.is_none() { return Err("trigger price required"); }

Try / catch

match client.submit_order(..., trigger_price) { Err(e) if e.to_string().contains("trigger price") => fix_and_resubmit_with_trigger(), r => r }

Prevention

When it happens

Trigger: Calling place_order (submit) with an order type like StopMarket/TrailingStopMarket/MarketIfTouched/LimitIfTouched but omitting the trigger_price parameter.

Common situations: Building conditional orders programmatically and forgetting to map the strategy's stop price into the trigger_price argument; copying a plain LIMIT/MARKET order construction for a conditional type.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/dd49705ee3d9f372. Report an issue: GitHub.

Appendix: source

Thrown at crates/adapters/binance/src/futures/http/client.rs:2169

        let binance_side = BinanceSide::try_from(order_side)?;
        let binance_order_type = order_type_to_binance_futures(order_type)?;
        let binance_tif = if post_only {
            BinanceTimeInForce::Gtx
        } else {
            BinanceTimeInForce::try_from(time_in_force)?
        };

        let requires_trigger_price = matches!(
            order_type,
            OrderType::StopMarket
                | OrderType::StopLimit
                | OrderType::TrailingStopMarket
                | OrderType::MarketIfTouched
                | OrderType::LimitIfTouched
        );

        if requires_trigger_price && trigger_price.is_none() {
            anyhow::bail!("Order type {order_type:?} requires a trigger price");
        }

        // MARKET and STOP_MARKET orders don't accept timeInForce
        let requires_time_in_force = matches!(
            order_type,
            OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched
        );

        let qty_str = quantity.to_string();
        let price_str = if price_match.is_some() {
            None
        } else {
            price.map(|p| p.to_string())
        };
        let stop_price_str = trigger_price.map(|p| p.to_string());
        let client_id_str = encode_broker_id(&client_order_id, BINANCE_NAUTILUS_FUTURES_BROKER_ID);

        let params = BinanceNewOrderParams {

View on GitHub (pinned to 18893faf8b)