nautechsystems/nautilus_trader · error · anyhow::Error

missing positive trigger_price for Binance algo order type {

Error message

missing positive trigger_price for Binance algo order type {:?}

What it means

For Binance Futures algo (conditional) order updates, the adapter requires a positive trigger_price whenever the order type is STOP, STOP_MARKET, TAKE_PROFIT, or TAKE_PROFIT_MARKET (requires_algo_trigger_price). The parsed trigger_price came back None because the raw field was empty, zero, or negative, so the update is rejected instead of silently accepted.

Source

Thrown at crates/adapters/binance/src/futures/websocket/streams/parse_exec.rs:449

    }

    Price::from_decimal_dp(decimal, precision)
        .map(Some)
        .map_err(|e| anyhow::anyhow!("invalid {field} precision: {e}"))
}

fn parse_algo_trigger_price(
    algo_data: &AlgoOrderUpdateData,
    price_precision: u8,
) -> anyhow::Result<Option<Price>> {
    let trigger_price = parse_positive_price_at_precision(
        &algo_data.trigger_price,
        price_precision,
        "trigger_price",
    )?;

    if trigger_price.is_none() && requires_algo_trigger_price(algo_data.order_type) {
        anyhow::bail!(
            "missing positive trigger_price for Binance algo order type {:?}",
            algo_data.order_type
        );
    }

    Ok(trigger_price)
}

fn parse_algo_limit_price(
    algo_data: &AlgoOrderUpdateData,
    price_precision: u8,
) -> anyhow::Result<Option<Price>> {
    let price = parse_positive_price_at_precision(&algo_data.price, price_precision, "price")?;

    if price.is_none() && requires_algo_limit_price(algo_data.order_type) {
        anyhow::bail!(
            "missing positive price for Binance algo order type {:?}",
            algo_data.order_type

View on GitHub (pinned to a4b06ed870)

Solutions

  1. Ensure conditional orders are always submitted with a strictly positive trigger/stop price
  2. Update NautilusTrader to the latest version so any newly mapped Binance order types are handled correctly
  3. Capture the raw algo order update payload (order type and trigger_price fields) and open an issue if the order type genuinely never carries a trigger price, which indicates a mapping bug

Example fix

# before
from nautilus_trader.model.objects import Price
# trigger_price omitted or set to 0 when submitting a STOP_MARKET

# after
order = trader.submit_order(
    strategy.stop_market(
        instrument_id,
        quantity,
        trigger_price=Price.from_str("42000.00"),  # strictly positive
    )
)
Defensive patterns

Strategy: validation

Validate before calling

from nautilus_trader.model.objects import Price

def valid_trigger(trigger_price) -> bool:
    return trigger_price is not None and trigger_price.as_double() > 0

assert valid_trigger(strategy.trigger_price), "STOP/TAKE_PROFIT orders need a positive trigger price"

Prevention

When it happens

Trigger: An algo order update arrives for a STOP / STOP_MARKET / TAKE_PROFIT / TAKE_PROFIT_MARKET order whose trigger_price string is missing, "0", or negative, so parse_positive_price_at_precision returned None and the requirement check fails.

Common situations: A strategy submitted a conditional order without a valid trigger (stop) price; Binance added or renamed an algo order type so the local enum mapping misclassifies it as trigger-requiring; malformed upstream event during connectivity issues.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16). Data as JSON: /api/errors/924b64de22485d84. Report an issue: GitHub.