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

Market-To-Limit

FIX OrdType <40>=K (Market With Left Over as Limit)

A Market‑To‑Limit order submits as a Market order. After the first fill, any unfilled quantity rests as a Limit order at that fill price.

Use cases

Use a Market‑To‑Limit order to take liquidity at the best available price without sweeping deeper levels. This can suit thin books or larger orders where limiting further market impact matters. Any remainder can stay unfilled if the market moves away from the first fill price.

Example

In the following example we create a Market-To-Limit order on the Interactive Brokers IdealPro Forex ECN to BUY 200,000 USD using JPY:

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

let order = self.order().market_to_limit(
    InstrumentId::from("USD/JPY.IDEALPRO"),
    OrderSide::Buy,
    Quantity::from(200_000),
    Some(TimeInForce::Gtc), // optional (default GTC)
    None,                   // expire_time
    Some(false),            // reduce_only (default false)
    None,                   // quote_quantity (default false)
    None,                   // display_qty (default full display)
    None,                   // exec_algorithm_id
    None,                   // exec_algorithm_params
    None,                   // tags
    None,                   // client_order_id
);

See the MarketToLimitOrder 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