ConceptsOrders
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. Examples include 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. The venue can still reject it or leave it unfilled when no market is available.
Example
Example: 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.