Market-To-Limit
FIX OrdType <40>=K (Market With Left Over as Limit)
A Market-To-Limit order submits as a market order at the current best price. If the order partially fills, the system cancels the remainder and resubmits it as a Limit order at the executed price.
Use cases
Use a Market-To-Limit order to take the liquidity available at the best price immediately, without sweeping deeper levels at worse prices: helpful in thin books, or for larger orders where you want the touch price but not the market impact of walking the book. The advantage is an immediate fill at the best price with any remainder resting there as a Limit rather than chasing. The tradeoff is that the unfilled remainder may sit unexecuted if the market moves away.
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.core.order_factory().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.