NautilusTrader
ConceptsOrders
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.

Stop-Market

FIX OrdType <40>=3 (Stop)

A Stop‑Market order releases a Market order when its trigger price is reached. It is often used as a stop‑loss: a SELL order against a LONG position or a BUY order against a SHORT position.

Use cases

Use a Stop‑Market order to prioritize execution after a price level is breached, such as for a protective stop‑loss or breakout entry. The trigger price is not a guaranteed fill price: a fast or gapping market can produce substantial slippage, and the released order can still be rejected or remain unfilled when no market is available. A Stop‑Limit provides price protection instead but may not fill.

Example

In the following example we create a Stop-Market order on the Binance Spot/Margin exchange to SELL 1 BTC at a trigger price of 100,000 USDT, active until further notice:

use nautilus_model::{
    enums::{OrderSide, TimeInForce, TriggerType},
    identifiers::InstrumentId,
    types::{Price, Quantity},
};

let order = self.order().stop_market(
    InstrumentId::from("BTCUSDT.BINANCE"),
    OrderSide::Sell,
    Quantity::from(1),
    Price::from("100000"),
    Some(TriggerType::LastPrice), // optional (default DEFAULT)
    Some(TimeInForce::Gtc),       // optional (default GTC)
    None,                         // expire_time
    Some(false),                  // reduce_only (default false)
    None,                         // quote_quantity (default false)
    None,                         // display_qty
    None,                         // emulation_trigger
    None,                         // trigger_instrument_id
    None,                         // exec_algorithm_id
    None,                         // exec_algorithm_params
    None,                         // tags
    None,                         // client_order_id
);

See the StopMarketOrder API reference for further details.

  • Orders - Trigger types and other execution instructions.
  • Emulated orders - Emulating conditional orders on venues without native support.
  • Execution - How orders reach the venue and fills are handled.

On this page