Skip to content
Sign In

Learning / Syntax / limit()

limit - Place Limit Orders at Specific Prices

Buy or sell a specified quantity at your limit price or better. An order can fill immediately if it crosses the market; otherwise it can remain pending.

Syntax

Smart Syntax
// Basic syntax
limit long|short <amount> off|at|@ <value>

// With optional parameters
limit long|short <amount> off <value> [post|taker] [reduce] [#tag]

// With inline SL/TP (see market command for details)
limit long|short <amount> off <value> sl off <sl_value> tp off <tp_value>

Parameters

long | shortRequired

Type: direction keyword | Values: long, short (buy, sell as aliases)

Specifies whether to go long (buy) or short (sell). Use an explicit side for every limit order.


amountRequired

Type: number or string

The quantity to trade. Can be specified in several ways:

FormatDescriptionExample
0.01Direct quantity0.01 BTC
50%Percentage of total balanceHalf your balance
50%%Percentage of available balanceHalf your free balance
50%pPercentage of positionHalf your position size

Required together with the order side. Position targets use a separate market command.


off / at / @Required

Type: number or string | Default: 1%

Use an absolute price with at/@, or an offset with off. Unsigned offsets choose direction automatically:

  • Long orders: off = BELOW current price (better entry)
  • Short orders: off = ABOVE current price (better exit)
FormatDescription
off 5050 quote-currency units from current price (auto-direction)
off 1%1% from current price (auto-direction)
off e5050 quote-currency units from average entry price
off e1%1% from average entry price
@ 50000Absolute price of 50000 quote-currency units (with space)
@50000Absolute price of 50000 quote-currency units (no space)

pos sets a target at market. A limit order instead requires a side, quantity and price; it does not calculate a final position target.


post | maker | takerOptional

Type: keyword | Default: none (exchange default)

Controls whether the order can take liquidity or must provide it:

KeywordBehavior
post or makerPost-only: order must add liquidity. If it would match immediately, it's rejected.
takerAllow immediate matching (can take liquidity)
(omitted)Post-only is off: immediate matching is allowed

Post-only requests maker execution where supported. It does not guarantee acceptance, a fill or that the order will remain open.


reduceOptional

Type: keyword | Default: omitted

Requests an order that only reduces your position, without increasing it. Exchange and position-mode rules apply; spot markets do not use futures reduce-only.


#tagOptional

Type: string

Applies a tag to the order for later cancellation. Multiple orders can share the same tag.

See cancel #tag for details. Tags label supported orders; comments use // on a separate line.

Examples

Example 1: Buy 0.01 BTC at $10 Below Current Price

Smart Syntax
BTCUSDT on My_API_Key
limit long 0.01 off 10

Places a buy limit for 0.01 BTC at 10 USDT below the current reference price. It fills only at that price or better; placement does not guarantee a fill.


Example 2: Sell a Fixed Quantity of ETH at a Limit Price

Smart Syntax
ETHUSDT on My_API_Key
limit short 0.01 at 4000

Places a sell limit for 0.01 ETH at 4000 USDT or better. This is an order quantity, not a target short position. It may fill immediately if the market can meet that price.


Example 3: Take Profit 3% Above Entry

Smart Syntax
BTCUSDT on My_API_Key
limit short 100%p off e3% reduce

Sells 100% of your position at 3% above your average entry price. The reduce flag ensures it only closes your position.


Example 4: Ladder Multiple Orders with Tags

Smart Syntax
ETHUSDT on My_API_Key
// Place 3 take profit orders
limit short 33%p off e5% #tp
limit short 33%p off e8% #tp
limit short 34%p off e12% #tp

Creates a ladder of 3 take profit orders at different levels. All tagged "tp" so they can be cancelled together with rem #tp.

Key Concepts

Limit vs Market Orders

  • Limit orders can fill immediately when they cross the market
  • Their limit constrains the fill price, but does not guarantee execution
  • Use when you want to buy lower or sell higher than current price
  • Perfect for scaling in/out of positions at specific levels

Offset Direction Logic

Flipr.Cloud uses intelligent offset logic:

  • Unsigned offsets choose direction from the order side
  • Buy orders: off 1% = 1% below the current price
  • Sell orders: off 1% = 1% above the current price
  • An explicit + or - sets direction directly, regardless of side

Post-Only Orders

Use post or maker to request post-only execution. Where supported, an order that would immediately take liquidity is rejected or cancelled. Acceptance and later execution still depend on the exchange and market.

Exchange-Specific Behavior

Limit order support and inline TP/SL behavior varies by exchange:

ExchangeInline TP/SLNotes
BitgetNativeFull support, TP/SL attached to position
ByBitNativeNative bracket orders
BinanceNativeBatch orders API
HTXDeferredTP/SL applied when limit fills (requires position)
ToobitDeferredTP/SL applied after limit fills
BitunixDeferredTP/SL applied after limit fills
KuCoinNot supportedUse separate stoploss/takeprofit commands

Related Commands

market() - Execute trades immediately at current price

stopOrder() - Trigger orders when price reaches a level

cancel() - Cancel pending limit orders