market - Execute Instant Market Orders
Execute trades immediately at the current market price. The fastest way to enter or exit positions.
Syntax
market long|short <amount>
pos <target>
market long|short <amount> reduce
market long|short <amount> ts <activation>/<callback>
market long|short <amount> sl off <sl> tp off <tp> ts <activation>/<callback>Parameters
long | shortRequiredType: direction keyword | Values: long, short (buy, sell as aliases)
Specifies whether to go long (buy) or short (sell). Not required when using the pos command.
amountRequiredType: number or string
The quantity to trade. Can be specified in several ways:
| Format | Description | Example |
|---|---|---|
0.01 | Direct quantity | 0.01 BTC |
50% | Percentage of total balance | Half your balance |
50%% | Percentage of available balance | Half your free balance |
50%p | Percentage of position | Half your position size |
2%r | Risk at the inline stop loss | 2% of total USDT balance; Bybit / WEEX linear futures |
n%rBybit / WEEX USDT FuturesSize a market entry from a risk budget at its inline stop. Supported on Bybit and WEEX USDT-settled linear futures; Bybit contracts must have a contract size of 1. Quantity = (total USDT balance × risk percentage) / distance between the reference price and the stop price. With a 1,000 USDT balance, 2% risk and a stop 3% away, the position value is about 666.67 USDT before quantity rounding. Leverage changes the margin required, not this risk budget.
ADAUSDT on My_Bybit_Key
market long 2%r sl off 3%Each entry risks its own percentage, including additions on the same side. Its SL and optional TP protect only that entry's executed quantity, leaving earlier trades' protection unchanged. Opposite positions can coexist in hedge mode. In one-way mode, close the opposite position before entering. Additions require compatible quantity-scoped protection. Bybit rejects existing full-position SL/TP or trailing protection; WEEX checks for existing full-position closing orders on the same side. Include a stop in the same market command. Use sl off with a percentage or price distance, or sl at/sl @ with an absolute price. The risk percentage must be greater than 0 and at most 100. An optional TP can use off, at orrr; it is rounded to the exchange tick before entry. Explicit SL/TP quantities, entry-relative stops, trailing stops, reduce-only orders and leverage multipliers are not supported with %r. Position targets and limit/stop entries cannot use %r. Market and position-mode checks must pass before the entry is submitted.
This is estimated risk based on a price snapshot before entry. Quantity is rounded down and orders outside exchange limits are rejected. Fees, funding and slippage can increase the actual loss. Concurrent trades and manual position changes can affect exposure after validation.
posAlternativeType: number or string | Aliases: position, target
Target position size after the order executes. Flipr.Cloud calculates the required trade automatically.
pos 0 always closes your entire position (alias: close)
How it works:
- Long 0.5 BTC +
pos 1.0→ buys 0.5 BTC - Long 0.5 BTC +
pos -0.5→ sells 1.0 BTC (close and reverse) pos 0→ closes entire position
reduceOptionalType: flag | Default: omitted (false)
Add reduce keyword to make the order reduce-only (will only reduce your position size, never increase it). Ignored on spot markets.
sl / tpOptionalType: inline parameters
Add stop loss and/or take profit directly to your market order. The argument order is important:
| Position | Argument | Required | Description |
|---|---|---|---|
| 1 | amount | Optional | Quantity to close. When omitted, uses the parent market order size. Use 100%p explicitly for the full live position. |
| 2 | price | Required | Price WITH PREFIX: off or at/@. For entry-relative offsets, use off e2%. |
| 3 | trigger | Optional | Trigger type (default: last). Values: mark, last, index |
Price Prefix is REQUIRED
sl 2% is INVALID - will be rejected!sl off 2% is VALID - uses current price offset
Valid price prefixes:
| Price format | Meaning | Example |
|---|---|---|
off | Offset from current price | sl off 2% → 2% from current price |
at / @ | Absolute price | tp at 50000 → exactly $50,000 |
off e… | Entry-relative offset | sl off e2% → 2% from your entry price |
rr | Risk/Reward ratio (TP only) | tp rr3 → TP at 3× SL distance |
tsOptionalBinance / HTX / WEEXType: inline trailing stop | Supported markets: Binance Futures, HTX V5 and WEEX Futures
Add ts to a market entry to place a native trailing stop after the entry order is filled. It can be used by itself or together with fixed sl and tp.
| Format | Meaning |
|---|---|
ts 2%/1.5% | Activate after a favorable 2% move, then trail by 1.5% |
ts @65000/1000 | Activate at 65000; convert 1000 quote-currency units to a callback percentage |
ts @65000 off 1000 | Same as above, with explicit offset syntax |
ts @65000/0.5% mark | Use mark price on Binance or WEEX; HTX supports last price only |
Inline ts requires a market entry. For a limit entry, send a standalone trailing stop after a position exists. See trailing-stop compatibility for callback ranges and trigger sources. Spot markets are not supported.
Examples
Example 1: Simple Buy Order
BTCUSDT on My_API_Key
market long 0.01Buys 0.01 BTC at the current market price immediately.
Example 2: Close Position Instantly
ETHUSDT on My_API_Key
pos 0Closes your entire position regardless of size or direction. Works for both long and short.
Example 3: Use 50% of Balance
BTCUSDT on My_API_Key
market long 50%Calculates 50% of your account balance and buys that amount of BTC at market price.
Example 4: Flip from Long to Short
ETHUSDT on My_API_Key
// First close any existing position
pos 0
// Then open a short with 75% of available balance
market short 75%%First closes any open position, then opens a short position using 75% of available balance.
Example 5: Reduce-Only Order (Futures)
BTCUSDT on My_API_Key
// Close 50% of position, will NOT increase if you're flat
market short 50%p reduceThe reduce keyword ensures this order can only reduce your position size. If you're long 1 BTC, it sells 0.5 BTC. If you're flat (no position), the order is rejected. This prevents accidentally opening a position when you meant to close.
Example 6: Market with Inline SL/TP
BTCUSDT on My_API_Key
// Enter long with stop loss and take profit
market long 0.01 sl off 2% tp off 5%Opens a 0.01 BTC long position with SL at -2% and TP at +5% from current price.
The prefix (off, at or @) is required!sl 2% will be rejected with an error.
Example 7: Entry-Relative SL/TP
ETHUSDT on My_API_Key
// SL/TP relative to entry price, not current price
market long 0.5 sl off e2% tp off e5%Use off before the e value to calculate SL/TP from the position's entry price. For a long position with a $3000 entry price, the calculated SL is $2940 (-2%) and TP is $3150 (+5%).
Example 8: Partial SL/TP with Custom Amount
BTCUSDT on My_API_Key
// Close only 50% at TP, use full position for SL
market long 0.02 sl off 2% tp 50%p off 5%Opens 0.02 BTC long. SL closes 100% (default), TP closes only 50%. The argument order is: tp [amount] prefix value [trigger]
Example 9: Market with Inline Trailing Stop
BTCUSDT on Binance_F
// Enter long, keep fixed protection, and add native trailing stop
market long 0.01 sl off 2% tp off 3% ts 2%/1.5%Opens a long position, places fixed SL/TP, and creates a Binance trailing stop that activates after a favorable 2% move with a 1.5% callback.
Key Concepts
Market vs Limit Orders
- Market orders execute immediately at whatever price is currently available
- They guarantee execution but not price
- Use when speed matters more than getting a specific price
- Be cautious on low-liquidity markets where slippage can be significant
Position Targeting
The position parameter is powerful for strategy automation:
- You specify where you want to end up, not what to trade
- Flipr.Cloud handles the math and determines buy/sell direction
- Especially useful when you don't know your current position state
Exchange-Specific Behavior
Market orders are supported across all exchanges, but inline SL/TP behavior varies:
| Exchange | Inline TP/SL | Notes |
|---|---|---|
| Bitget | Native | Full support including partial quantities |
| ByBit | Native | Partial: requires tpSize = slSize |
| Bitunix | Full only | Partial via separate endpoint |
| Binance | Order-level | Creates separate stop orders |
| KuCoin | Native | Via st-orders (ignores partial qty) |
| HTX | Trigger orders | CCXT limitation - uses separate triggers |
| Phemex | Fallback | Error 11074 if existing positions - auto fallback |
Flipr.Cloud automatically uses the best available method for each exchange. If native TP/SL fails, it falls back to separate stop orders with OCO monitoring.
Related Commands
limit - Place orders at specific price levels
stoploss - Standalone stop loss orders
takeprofit - Standalone take profit orders
trailing-stop - Native trailing stops for Binance Futures, HTX V5 and WEEX Futures
rem / cancel - Cancel pending orders