Market Orders: Immediate Execution and Price Risk
Summary
A market order tells a venue to execute a specified quantity promptly at the best available price. The document outlines when traders might use one, such as urgent risk reduction or entering a liquid, fast-moving market, and shows how an order can include time-in-force and reduce-only instructions.
The examples illustrate submitting a market order through a trading framework for a foreign-exchange pair. The central trade-off is execution urgency versus price certainty: a market order has no price limit, so it can incur spread costs and slippage. Execution is not guaranteed either; the venue may reject the order or leave it unfilled if no market is available. The examples are implementation guidance rather than evidence of execution quality, and the document provides no comparison with limit orders or estimates of trading costs.
Key ideas
- A market order seeks prompt execution at the best available price.
- Traders may use market orders when speed matters more than price precision.
- Market orders can incur spread costs and slippage because they have no price protection.
- A venue may reject or leave a market order unfilled when no market is available.
- Time-in-force and reduce-only instructions can accompany a market order.
Tags
Full text
# Market
# 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](https://ibkr.info/node/1708) Forex ECN to BUY 100,000 AUD using USD:
```rust tab="Rust"
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)
);
```
```python tab="Python"
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import MarketOrder
from nautilus_trader.model import OrderSide
from nautilus_trader.model import Quantity
from nautilus_trader.model import TimeInForce
order: MarketOrder = self.order_factory.market(
instrument_id=InstrumentId.from_str("AUD/USD.IDEALPRO"),
order_side=OrderSide.BUY,
quantity=Quantity.from_int(100_000),
time_in_force=TimeInForce.IOC, # <-- optional (default GTC)
reduce_only=False, # <-- optional (default False)
tags=["ENTRY"], # <-- optional (default None)
)
```
See the [`MarketOrder` API reference](/docs/python-api-latest/model/orders.html#nautilus_trader.model.MarketOrder)
for further details.
## Related guides
- [Orders](index.md) - Order concepts, execution instructions, and the order factory.
- [Execution](../execution/) - How orders reach the venue and fills are handled.Shown in full with attribution under the source's licence. Licence: LGPL-3.0
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.