Skip to content
All library documents

Limit Orders for Price Control and Liquidity Provision

Article NautilusTrader

Summary

A limit order rests in the order book at a chosen price and can execute only at that price or a more favorable one. Traders can use it to control execution price, provide liquidity, make markets, scale into or out of positions, or seek maker fees when supported by a post-only instruction.

The document illustrates a sell limit order for a perpetual futures contract and shows how to specify quantity, price, time in force, post-only behavior, and other optional order settings in two programming languages. A limit price caps how poor the execution can be, but it does not guarantee execution: the order may remain open or fill only partially. The example explains order construction rather than comparing execution outcomes or measuring performance, and the behavior of options such as post-only depends on venue support.

Key ideas

  • A limit order executes only at its specified price or at a better price for the trader.
  • Limit orders can control execution prices and may provide liquidity to the order book.
  • Common applications include market making and entering or exiting positions at chosen levels.
  • Post-only settings can target maker treatment when the venue supports them.
  • Limit orders may remain unfilled or receive only a partial fill.

Tags

Full text
# Limit


# Limit

`FIX OrdType <40>=2`

A *Limit* order rests on the limit order book at a specified price and executes only at that price
or better.

## Use cases

Use a *Limit* order to control the execution price and, when appropriate, provide liquidity. Common
uses include market making, scaling into or out of a position at chosen levels, and targeting maker
fees with `post_only`. The order cannot fill worse than its limit price, but it may remain unfilled or
fill only partially.

## Example

In the following example we create a *Limit* order on the Binance Futures Crypto exchange to SELL
20 ETHUSDT-PERP Perpetual Futures contracts at a limit price of 5000 USDT, as a market maker.

```rust tab="Rust"
use nautilus_model::{
    enums::{OrderSide, TimeInForce},
    identifiers::InstrumentId,
    types::{Price, Quantity},
};

let order = self.order().limit(
    InstrumentId::from("ETHUSDT-PERP.BINANCE"),
    OrderSide::Sell,
    Quantity::from(20),
    Price::from("5000.00"),
    Some(TimeInForce::Gtc), // optional (default GTC)
    None,                   // expire_time
    Some(true),             // post_only (default false)
    Some(false),            // reduce_only (default false)
    None,                   // quote_quantity (default false)
    None,                   // display_qty (default full display)
    None,                   // emulation_trigger
    None,                   // trigger_instrument_id
    None,                   // exec_algorithm_id
    None,                   // exec_algorithm_params
    None,                   // tags
    None,                   // client_order_id
);
```

```python tab="Python"
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import LimitOrder
from nautilus_trader.model import OrderSide
from nautilus_trader.model import Price
from nautilus_trader.model import Quantity
from nautilus_trader.model import TimeInForce

order: LimitOrder = self.order_factory.limit(
    instrument_id=InstrumentId.from_str("ETHUSDT-PERP.BINANCE"),
    order_side=OrderSide.SELL,
    quantity=Quantity.from_int(20),
    price=Price.from_str("5_000.00"),
    time_in_force=TimeInForce.GTC,  # <-- optional (default GTC)
    expire_time=None,  # <-- optional (default None)
    post_only=True,  # <-- optional (default False)
    reduce_only=False,  # <-- optional (default False)
    display_qty=None,  # <-- optional (default None which indicates full display)
    tags=None,  # <-- optional (default None)
)
```

See the [`LimitOrder` API reference](/docs/python-api-latest/model/orders.html#nautilus_trader.model.LimitOrder)
for further details.

## Related guides

- [Orders](index.md) - Order concepts, execution instructions, and the order factory.
- [Emulated orders](emulated.md) - Emulating *Limit* orders, released as *Market* orders on trigger.
- [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.