Market
FIX OrdType <40>=1
A Market order is an instruction by the trader to immediately trade the given quantity at the best price available. You can also specify several time in force options, and indicate whether this order is only intended to reduce a position.
Use cases
Use a Market order when filling matters more than the exact price: urgent risk reduction, entering a fast-moving liquid market, or crossing a tight spread where waiting costs more than the spread. The advantage is near-certain, immediate execution. The tradeoff is no price protection: you pay the spread and risk slippage in thin or fast markets, so it suits liquid instruments far more than illiquid ones.
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.core.order_factory().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.