nautechsystems/nautilus_trader · error

Take profit limit order missing trigger_price

Error message

Take profit limit order missing trigger_price

What it means

Nautilus LimitIfTouched orders map to dYdX TAKE_PROFIT_LIMIT conditional orders, which require both a trigger_price and a limit price. The client checks order.trigger_price() first and throws this error when it is None.

Source

Thrown at crates/adapters/dydx/src/execution/mod.rs:1527

                            anyhow::anyhow!("Take profit market order missing trigger_price")
                        })?;
                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);
                        let msg = order_builder.build_take_profit_market_order(
                            instrument_id,
                            client_id_u32,
                            client_metadata,
                            order.order_side(),
                            trigger_price,
                            order.quantity(),
                            order.is_reduce_only(),
                            cond_expire,
                        )?;
                        (msg, "take_profit_market")
                    }
                    // dYdX TakeProfitLimit maps to Nautilus LimitIfTouched
                    OrderType::LimitIfTouched => {
                        let trigger_price = order.trigger_price().ok_or_else(|| {
                            anyhow::anyhow!("Take profit limit order missing trigger_price")
                        })?;
                        let limit_price = order.price().ok_or_else(|| {
                            anyhow::anyhow!("Take profit limit order missing limit price")
                        })?;
                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);
                        let msg = order_builder.build_take_profit_limit_order(
                            instrument_id,
                            client_id_u32,
                            client_metadata,
                            order.order_side(),
                            trigger_price,
                            limit_price,
                            order.quantity(),
                            order.time_in_force(),
                            order.is_post_only(),
                            order.is_reduce_only(),
                            cond_expire,
                        )?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Pass trigger_price to the limit_if_touched factory call
  2. Validate trigger_price and price are both present before submit
  3. Use plain Limit if no trigger condition is intended

Example fix

// before
let order = factory.limit_if_touched(id, side, qty, price, None); // trigger missing
// after
let order = factory.limit_if_touched(id, side, qty, price, Some(trigger_price));
Defensive patterns

Strategy: validation

Validate before calling

if order.order_type() == OrderType::LimitIfTouched {
    if order.trigger_price().is_none() {
        return Err("LimitIfTouched (dYdX take-profit limit) requires a trigger_price".into());
    }
    if order.price().is_none() {
        return Err("LimitIfTouched (dYdX take-profit limit) requires a limit price".into());
    }
}

Type guard

fn limit_if_touched_complete(order: &OrderAny) -> bool {
    order.trigger_price().is_some() && order.price().is_some()
}

Try / catch

if let Err(e) = client.submit_order(order).await {
    if e.to_string().contains("Take profit limit order missing") {
        // rebuild with trigger and limit prices
    }
}

Prevention

When it happens

Trigger: Submitting a LimitIfTouched order whose trigger_price was never set (factory call omitted it, or a plain limit order converted to LIT).

Common situations: order_factory.limit_if_touched call missing trigger_price; migrating from Limit to LimitIfTouched without adding the trigger; strategy supplying only the limit price.

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/ded7eeca509edb72. Report an issue: GitHub.