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

Market

FIX OrdType <40>=1

A Market order instructs the venue to trade a quantity immediately at the best available price. It can also carry time in force and reduce‑only instructions.

Use cases

Use a Market order when prompt execution matters more than the exact price, such as for urgent risk reduction or entry into a liquid, fast‑moving market. A Market order has no price protection: it can incur spread costs and slippage, and the venue can still reject it or leave it unfilled when no market is available.

Example

In the following example we create a Market order on the Interactive Brokers IdealPro Forex ECN to BUY 100,000 AUD using USD:

use nautilus_model::{
    enums::{OrderSide, TimeInForce},
    identifiers::InstrumentId,
    types::Quantity,
};
use ustr::Ustr;

let order = self.order().market(
    InstrumentId::from("AUD/USD.IDEALPRO"),
    OrderSide::Buy,
    Quantity::from(100_000),
    Some(TimeInForce::Ioc),          // optional (default GTC)
    Some(false),                     // reduce_only (default false)
    None,                            // quote_quantity (default false)
    None,                            // exec_algorithm_id
    None,                            // exec_algorithm_params
    Some(vec![Ustr::from("ENTRY")]), // tags
    None,                            // client_order_id (auto-generated if None)
);

See the MarketOrder API reference for further details.

  • Orders - Order concepts, execution instructions, and the order factory.
  • Execution - How orders reach the venue and fills are handled.

On this page