0xhardman

0xhardman

twitter
medium
jike
github

What API did you use to place the order? Comparison and analysis of the Binance USDS-M futures order interface and API order parameters.

What API Did You Use to Place Orders? Comparison and Analysis of Binance USDS-M Futures Order Interface and API Order Parameters#

Request Parameter Description#

Parameter NameTypeRequiredDescription
symbolSTRINGYESTrading pair
sideENUMYESBuy/Sell direction SELL, BUY
positionSideENUMNOPosition direction, not required in single position mode, default and can only be BOTH; required in dual position mode, and can only choose LONG or SHORT
typeENUMYESOrder type LIMIT, MARKET, STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
reduceOnlySTRINGNOtrue, false; default false in non-dual opening mode; not accepted in dual opening mode; does not support this parameter when using closePosition.
quantityDECIMALNOOrder quantity, does not support this parameter when using closePosition.
priceDECIMALNOOrder price
newClientOrderIdSTRINGNOUser-defined order ID, cannot appear repeatedly in pending orders. If missing, the system will automatically assign a value. Must meet the regex rule ^[.A-Z:/a-z0-9_-]{1,36}$
stopPriceDECIMALNOTrigger price, only STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET require this parameter
closePositionSTRINGNOtrue, false; close all positions after triggering, only supports STOP_MARKET and TAKE_PROFIT_MARKET; cannot be used with quantity; inherently only has a closing effect, cannot be used with reduceOnly
activationPriceDECIMALNOActivation price for trailing stop loss, only TRAILING_STOP_MARKET requires this parameter, defaults to the current market price at the time of order (supports different workingType)
callbackRateDECIMALNOTrailing stop loss callback rate, can take values in the range [0.1, 10], where 1 represents 1%, only TRAILING_STOP_MARKET requires this parameter
timeInForceENUMNOValid methods GTC/IOC/FOK/GTX/GTD, required for LIMIT orders
workingTypeENUMNOstopPrice trigger type: MARK_PRICE (mark price), CONTRACT_PRICE (latest contract price). Default is CONTRACT_PRICE
priceProtectSTRINGNOConditional order trigger protection: "TRUE", "FALSE", default "FALSE". Only STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET require this parameter
newOrderRespTypeENUMNO"ACK", "RESULT", default "ACK"
priceMatchENUMNOOPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20; cannot be transmitted with price at the same time
selfTradePreventionModeENUMNOEXPIRE_TAKER/ EXPIRE_MAKER/ EXPIRE_BOTH; default NONE
goodTillDateLONGNOAutomatic cancellation time of the order when TIF is GTD, must be passed when timeInForce is GTD; the passed timestamp retains only second-level precision, the millisecond part will be automatically ignored, the timestamp must be greater than the current time + 600s and less than 253402300799000
recvWindowLONGNO
timestampLONGYES

Parameter Option Details#

type (Order Type)#

Binance Order Types
API ParameterBinance Chinese InterfaceDescription
LIMITLimit OrderRequires specifying a price, executed at the specified price or better
MARKETMarket OrderExecuted immediately at the current market price
STOPLimit Stop Loss/Take ProfitWhen the price reaches stopPrice, place a limit order at the specified price
TAKE_PROFITLimit Stop Loss/Take ProfitWhen the price reaches stopPrice, place a limit order at the specified price
STOP_MARKETMarket Stop Loss/Take ProfitWhen the price reaches stopPrice, place a market order
TAKE_PROFIT_MARKETMarket Stop Loss/Take ProfitWhen the price reaches stopPrice, place a market order
TRAILING_STOP_MARKETTrailing OrderDynamically adjusts the stop loss price based on price changes

Other Binance interface functions correspond:

  • Only Maker = timeInForce=GTX
  • Conditional Order = STOP/TAKE_PROFIT type orders
  • Time-weighted Order = timeInForce=GTD + goodTillDate
  • Segmented Orders = Combination of multiple orders, not a single API parameter

Binance APP Order Interface "Take Profit/Stop Loss" Parameters:

Binance Order Types
  • Take Profit Price = stopPrice (when selecting TAKE_PROFIT type)
  • Stop Loss Price = stopPrice (when selecting STOP type)
  • Take Profit/Stop Loss Method Selection:
    • Limit Price = TAKE_PROFIT or STOP + price parameter
    • Market Price = TAKE_PROFIT_MARKET or STOP_MARKET
  • Trigger Condition = workingType (mark price/latest price)

Important Note: Setting Take Profit and Stop Loss on Binance APP = Multiple Orders
When you select the take profit and stop loss function in the APP:

  1. Main Order: Opening order (LIMIT or MARKET)
  2. Take Profit Order: TAKE_PROFIT or TAKE_PROFIT_MARKET order
  3. Stop Loss Order: STOP or STOP_MARKET order

In fact, it is equivalent to calling the API 3 times, creating 3 independent orders. When one of the take profit or stop loss orders is triggered, the other will be automatically canceled (OCO mechanism).

Actual Case: Market Order + Take Profit and Stop Loss
The following is a real API call for setting take profit and stop loss in the market order interface:

// 1. Main Order: Market Buy
{
  "type": "MARKET",
  "side": "BUY", 
  "quantity": "0.014",
  "price": "0"                 // Market order has no price
}

// 2. Take Profit Order: Market Take Profit (automatically generated)
{
  "type": "TAKE_PROFIT_MARKET",
  "side": "SELL",
  "stopPrice": "3700",         // Key: Take profit trigger price
  "reduceOnly": true,          // Key: Only reduce position
  "price": "0"                 // Market execution
}

// 3. Stop Loss Order: Market Stop Loss (automatically generated)
{
  "type": "STOP_MARKET",
  "side": "SELL", 
  "stopPrice": "3300",         // Key: Stop loss trigger price
  "reduceOnly": true,          // Key: Only reduce position
  "price": "0"                 // Market execution
}

Key Features:

  • Take profit and stop loss orders automatically set reduceOnly=true (only reduce position)
  • All three orders have the same quantity (0.014)
  • Take profit and stop loss orders are automatically created after the main order is executed

reduceOnly (Only Reduce Position)#

Binance Order Types
  • true - Can only reduce existing positions, cannot increase positions or open new positions
  • false - Can increase positions or open new positions (default value)
  • Note: Not accepted in dual position mode; does not support this parameter when using closePosition

Usage Scenarios:

  1. Partial Position Closing: Already holding a long position, want to partially close but do not want to open a short position
  2. Risk Control: Ensure that the order will only reduce risk exposure, not increase it
  3. Take Profit and Stop Loss: When setting take profit and stop loss orders, only want to close positions without opening a reverse position
  4. Capital Management: When the position is close to the liquidation price, only allow reduction operations

Actual Examples:
Scenario 1 - Programmatic Trading:

  • Holding 100 BTC long contracts
  • The program automatically places an order to sell 150 BTC (possibly based on signals or algorithms)
  • Set reduceOnly=true as a safety measure
  • The order will only close 100 BTC, the remaining 50 will be rejected, avoiding accidental short positions

Scenario 2 - Stop Loss Order:

  • Holding 50 BTC short contracts
  • Set a stop loss order: buy 100 BTC, reduceOnly=true
  • When triggered, it will only close 50 BTC short, the remaining 50 will be rejected
  • Prevent the stop loss order from turning into a long position

Scenario 3 - Batch Closing:

  • Simultaneously holding positions in multiple contracts
  • When placing batch orders to close positions, some contract positions may have already been partially closed by other orders
  • reduceOnly=true ensures that there will be no excessive closing

Core Function:

  • Mainly for safety protection, preventing accidental excessive trading
  • Especially suitable for programmatic trading and automated strategies

Difference from Regular Orders:

  • Regular orders: If the sell quantity exceeds the position, the excess will queue up waiting
  • reduceOnly=true: The excess part will be directly rejected, ensuring no accidental overselling

Restrictions:

  • Single position mode: Can be used
  • Dual position mode: This parameter is not supported
  • Mutually exclusive with closePosition=true, cannot be used simultaneously

closePosition (Close Position Flag)#

Binance Order Types
  • true - Close all positions after triggering
  • false - Do not close positions (default value)
  • Only supports: STOP_MARKET and TAKE_PROFIT_MARKET
  • Cannot be used with quantity; inherently only has a closing effect, cannot be used with reduceOnly

Corresponding Exchange Interface Settings:
When you set take profit and stop loss in the Binance APP:

  • Quantity Selection → Choose "All" or "100%"
  • Execution Method → Choose "Market Execution" (instead of "Limit Execution")
  • Trigger Condition → Choose "Mark Price" or "Latest Price" (this is the workingType parameter)
  • At this time, the API will automatically set closePosition=true

Actual Scenario:

  • Position: 100 BTC long
  • Set a stop loss in the APP, quantity selection "All", type selection "Market"
  • Corresponding API: type=STOP_MARKET, closePosition=true
  • When triggered: Automatically close all 100 BTC, no need to specify a specific quantity

Difference from Manually Entered Quantity:

  • Manually entered quantity: quantity=100
  • Selecting to close all positions: closePosition=true (more convenient, no need to calculate specific quantity)

priceMatch (Price Matching Mode)#

Binance Order Types

In the exchange APP, you may see a parameter BBO (Best Bid and Offer), which actually sets this parameter

  • OPPONENT - Opponent price (best buy/sell price)
  • OPPONENT_5 - Opponent price plus 5 ticks
  • OPPONENT_10 - Opponent price plus 10 ticks
  • OPPONENT_20 - Opponent price plus 20 ticks
  • QUEUE - Queue price (buy/sell price)
  • QUEUE_5 - Queue price plus 5 ticks
  • QUEUE_10 - Queue price plus 10 ticks
  • QUEUE_20 - Queue price plus 20 ticks
  • Note: Cannot be used with the price parameter at the same time

What is a tick (minimum price unit)?

  • Each contract has a minimum price movement unit
  • For example: BTCUSDT futures tick = 0.1 USDT
  • Plus 5 ticks = price + (5 × 0.1) = price + 0.5 USDT

Actual Example:
Assuming the current BTCUSDT price:

  • Buy price: 50000.0
  • Sell price: 50000.1
  • Tick size: 0.1

Then:

  • OPPONENT = 50000.1 (sell price)
  • OPPONENT_5 = 50000.1 + (5×0.1) = 50000.6
  • QUEUE = 50000.0 (buy price)
  • QUEUE_5 = 50000.0 + (5×0.1) = 50000.5

selfTradePreventionMode (Self-Trade Prevention Mode)#

  • NONE - No self-trade protection (default value)
  • EXPIRE_TAKER - When acting as a taker, cancel new orders
  • EXPIRE_MAKER - When acting as a maker, cancel old orders
  • EXPIRE_BOTH - Cancel both new and old orders

Distinction Between Maker and Taker:

  • Maker: Orders that are placed on the order book waiting to be filled, providing liquidity
  • Taker: Orders that immediately match with existing orders on the order book, consuming liquidity
  • Distinction Standard: Based on the timing of order execution, not the buy/sell direction
    • The first order = Maker
    • The later order = Taker
    • Both buy and sell orders can be either Maker or Taker

Specific Example:
Assuming you have a trading account and the following situation on the BTC/USDT trading pair:

  • You placed a sell order at 50,000 USDT (first order = Maker order)
  • Then you want to place a buy order at 50,000 USDT (later order = Taker order)

Behavior of Different Modes:

  1. NONE (default):

    • Your buy order will directly fill your own sell order
    • Result: Self-trade occurs, you pay the fee but your position remains unchanged
  2. EXPIRE_TAKER:

    • The system detects that a self-trade will occur
    • The new buy order (taker) is canceled
    • The original sell order (maker) remains unchanged
  3. EXPIRE_MAKER:

    • The system detects that a self-trade will occur
    • The original sell order (maker) is canceled
    • The new buy order (taker) will look for other orders to fill
  4. EXPIRE_BOTH:

    • The system detects that a self-trade will occur
    • Both new and old orders are canceled
    • No trades occur

Actual Application Scenario:

  • Quantitative trading bots often encounter this situation
  • Particularly common in grid trading strategies
  • Using EXPIRE_TAKER can protect existing order strategies

timeInForce (Order Validity Time)#

Binance Order Types
  • GTC - Good Till Cancel, valid until canceled
  • IOC - Immediate or Cancel, executed immediately, unfilled parts are canceled
  • FOK - Fill or Kill, either fully filled or fully canceled
  • GTX - Good Till Crossing, passive order, only acts as maker (displayed as "Only Maker" in the Binance APP)
  • GTD - Good Till Date, canceled at a specified time (must be used with goodTillDate) (displayed as "Time-weighted Order" in the Binance APP)

Applicable Order Types:

  • LIMIT - Required, supports all timeInForce options
  • STOP - Optional, default GTC, supports all timeInForce options
  • TAKE_PROFIT - Optional, default GTC, supports all timeInForce options

Not Supporting timeInForce:

  • MARKET - Not supported, market orders are executed immediately
  • STOP_MARKET - Not supported, executed as market orders immediately after triggering
  • TAKE_PROFIT_MARKET - Not supported, executed as market orders immediately after triggering
  • TRAILING_STOP_MARKET - Not supported, executed as market orders immediately after triggering

workingType (Conditional Price Type)#

Binance Order Types
  • CONTRACT_PRICE - Latest contract price (default value)
  • MARK_PRICE - Mark price

Meaning of "Conditional Price Type":

  • The "condition" here refers to the trigger condition, not the ordinary buy/sell price
  • Only applicable to conditional orders: STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET
  • Determines what price is used to judge whether the stopPrice trigger condition has been met

Difference Between the Two Prices:

CONTRACT_PRICE (Latest Contract Price):

  • The latest price at which the transaction was executed, based on real buy/sell orders
  • May be quickly influenced by large orders
  • More volatile and easier to manipulate

MARK_PRICE (Mark Price):

  • The "fair price" calculated by the exchange
  • Usually calculated based on spot price + funding rate and other factors
  • More stable, less prone to manipulation, used to calculate unrealized profits and losses and liquidation prices

Actual Example:
Setting a stop loss order: stopPrice = 49,000

  • CONTRACT_PRICE mode: Triggered when the latest contract transaction price falls below 49,000 (may be triggered by a sudden spike)
  • MARK_PRICE mode: Triggered when the mark price falls below 49,000 (more stable, less prone to manipulation)

Usage Suggestions:

  • CONTRACT_PRICE: Suitable for short-term trading, sensitive to price
  • MARK_PRICE: Suitable for avoiding sudden spikes, more stable and reliable

priceProtect (Price Protection)#

Binance Order Types
  • TRUE - Enable price protection to prevent excessive price deviation (over 5%)
  • FALSE - Disable price protection (default value)
  • Only applicable to: STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET

Understanding priceProtect (Price Protection):

Core Function:

  • Prevent conditional orders from being executed at prices that deviate too far from the market in extreme market conditions
  • After the order has been triggered, check if the current market price is reasonable

Working Mechanism:

  1. Trigger Judgment: Determine if the stopPrice has been reached based on workingType
  2. Order Trigger: If conditions are met, prepare to place the order
  3. Price Protection: If priceProtect=TRUE is enabled, check the current market price
  4. Execution Decision: Execute if the price is reasonable, reject if unreasonable

Specific Scenario:
Assuming you set a stop loss order: stopPrice = 49,000, type = STOP_MARKET

Without Price Protection (FALSE):

  • When the price falls below 49,000, immediately place a market order
  • May execute at 48,000, 47,000, or even lower (if market liquidity is poor)

With Price Protection (TRUE):

  • When the price falls below 49,000, the system checks the current market price
  • If the current price is 48,500 (not too far off), execute normally
  • If the current price is 45,000 (too far off), the order is rejected

Protection Goals:

  • Prevent execution at extreme prices during market crashes
  • Avoid significant slippage losses due to insufficient liquidity
  • Give users a chance to "reconsider"

Applicable Scenarios:

  • Especially suitable for large orders
  • During periods of high market volatility
  • Trading pairs with poor liquidity

Notes:

  • Enabling may lead to stop loss orders not being executed, requiring a balance between protection and execution efficiency
  • Independent of the workingType parameter, can be used in any combination

positionSide (Position Direction)#

  • BOTH - Default value in single position mode
  • LONG - Going long in dual position mode
  • SHORT - Going short in dual position mode

Position Mode Description:

Single Position Mode (Default):

  • Only one direction of net position can be held for the same trading pair
  • Buy operation: If there is a short position, close it first, the remaining part opens a long position
  • Sell operation: If there is a long position, close it first, the remaining part opens a short position
  • Simple and intuitive, suitable for beginners
  • API parameter: positionSide=BOTH

Dual Position Mode:

  • Can hold both long and short positions for the same trading pair simultaneously
  • Must clearly specify whether to go long or short
  • Can implement more complex hedging strategies
  • Risk management is more complex, requiring separate management of long and short positions
  • API parameter: positionSide=LONG or positionSide=SHORT

Switching Position Modes in the Binance APP:

  1. Click the three dots in the upper right corner of the contract trading page
  2. Find the "Position Mode" option
  3. Switch from "Single Position" to "Dual Position"
  4. Note: All positions must be closed before switching
Binance Order Types Binance Order Types

Interface Display Differences:

  • Single Position: Only shows "Buy/Sell" buttons
  • Dual Position: Shows "Go Long/Go Short" selection, or "Open Long/Open Short/Close Long/Close Short" buttons

Notes:

  • The reduceOnly parameter is not supported in dual position mode
  • The positionSide parameter must be specified in dual position mode
  • In single position mode, the positionSide parameter is optional, defaulting to BOTH

newOrderRespType (Response Type)#

  • ACK - Confirmation information, returns basic order information (default value)
  • RESULT - Order result, returns detailed order information and transaction information

Response Example:

ACK Response (Basic Information):

{
  "orderId": 28,
  "symbol": "BTCUSDT",
  "status": "NEW",
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "price": "0.1",
  "avgPrice": "0.00000",
  "origQty": "10",
  "executedQty": "0",
  "cumQty": "0",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "reduceOnly": false,
  "closePosition": false,
  "side": "SELL",
  "positionSide": "SHORT",
  "stopPrice": "0",
  "workingType": "CONTRACT_PRICE",
  "priceProtect": false,
  "origType": "LIMIT",
  "time": 1499827319559,
  "updateTime": 1499827319559
}

RESULT Response (Detailed Information):

{
  "orderId": 28,
  "symbol": "BTCUSDT",
  "status": "FILLED",
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "price": "0.1",
  "avgPrice": "0.10000",
  "origQty": "10",
  "executedQty": "10",
  "cumQty": "10",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "reduceOnly": false,
  "closePosition": false,
  "side": "SELL",
  "positionSide": "SHORT",
  "stopPrice": "0",
  "workingType": "CONTRACT_PRICE",
  "priceProtect": false,
  "origType": "LIMIT",
  "time": 1499827319559,
  "updateTime": 1499827319559,
  "fills": [
    {
      "price": "0.10000000",
      "qty": "5.00000000",
      "commission": "0.00000500",
      "commissionAsset": "USDT",
      "tradeId": 56
    },
    {
      "price": "0.10000000", 
      "qty": "5.00000000",
      "commission": "0.00000500",
      "commissionAsset": "USDT",
      "tradeId": 57
    }
  ]
}

Main Differences:

  • ACK: Only returns basic order status, does not include transaction details
  • RESULT: Includes detailed transaction information (fills array) and fee details
  • Performance: ACK response is faster, RESULT response is more detailed but slightly slower

Detailed Explanation of Each Order Type Parameters#

1. Limit Order#

When selecting "Limit Order" in the Binance APP, the corresponding API parameters are:

Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "LIMIT",              // Required: Order type - Key parameter
  "timeInForce": "GTC",         // Required: Valid time - Key parameter
  "quantity": "0.1",            // Required: Order quantity
  "price": "3450.00",           // Required: Order price - Key parameter
  
  // Optional parameters
  "positionSide": "BOTH",       // Position direction (default BOTH in single position)
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_order_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
}

2. Market Order#

When selecting "Market Order" in the Binance APP, the corresponding API parameters are:

Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "MARKET",             // Required: Order type - Key parameter
  "quantity": "0.1",            // Required: Order quantity
  
  // Optional parameters
  "positionSide": "BOTH",       // Position direction (default BOTH in single position)
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_order_002", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Note: Market orders do not require price parameter - Key feature
}

3. Limit Stop Loss/Take Profit#

When selecting Stop Loss/Take Profit in the Binance APP and choosing "Limit" for execution, the corresponding API parameters are:

Stop Loss Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "SELL",               // Required: Buy/Sell direction
  "type": "STOP",               // Required: Order type - Key parameter
  "quantity": "0.1",            // Required: Order quantity
  "price": "3400.00",           // Required: Execution price after trigger - Key parameter
  "stopPrice": "3420.00",       // Required: Trigger price - Key parameter
  
  // Optional parameters
  "timeInForce": "GTC",         // Valid time (default GTC)
  "workingType": "MARK_PRICE",  // Trigger condition: mark price/latest price - Key parameter
  "priceProtect": false,        // Price protection
  "positionSide": "BOTH",       // Position direction
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_stop_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
}

Take Profit Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "SELL",               // Required: Buy/Sell direction
  "type": "TAKE_PROFIT",        // Required: Order type - Key parameter
  "quantity": "0.1",            // Required: Order quantity
  "price": "3600.00",           // Required: Execution price after trigger - Key parameter
  "stopPrice": "3580.00",       // Required: Trigger price - Key parameter
  
  // Optional parameters
  "timeInForce": "GTC",         // Valid time (default GTC)
  "workingType": "MARK_PRICE",  // Trigger condition: mark price/latest price - Key parameter
  "priceProtect": false,        // Price protection
  "positionSide": "BOTH",       // Position direction
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_tp_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
}

4. Market Stop Loss/Take Profit#

When selecting Stop Loss/Take Profit in the Binance APP and choosing "Market" for execution, the corresponding API parameters are:

Stop Loss Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "SELL",               // Required: Buy/Sell direction
  "type": "STOP_MARKET",        // Required: Order type - Key parameter
  "stopPrice": "3420.00",       // Required: Trigger price - Key parameter
  
  // Quantity parameter (choose one)
  "quantity": "0.1",            // Specify quantity
  // "closePosition": true,      // Or close all positions - Key parameter
  
  // Optional parameters
  "workingType": "MARK_PRICE",  // Trigger condition: mark price/latest price - Key parameter
  "priceProtect": false,        // Price protection
  "positionSide": "BOTH",       // Position direction
  "newClientOrderId": "my_stop_market_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Note: Market stop loss does not require price parameter, executed at market price after trigger - Key feature
}

Take Profit Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "SELL",               // Required: Buy/Sell direction
  "type": "TAKE_PROFIT_MARKET", // Required: Order type - Key parameter
  "stopPrice": "3580.00",       // Required: Trigger price - Key parameter
  
  // Quantity parameter (choose one)
  "quantity": "0.1",            // Specify quantity
  // "closePosition": true,      // Or close all positions - Key parameter
  
  // Optional parameters
  "workingType": "MARK_PRICE",  // Trigger condition: mark price/latest price - Key parameter
  "priceProtect": false,        // Price protection
  "positionSide": "BOTH",       // Position direction
  "newClientOrderId": "my_tp_market_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Note: Market take profit does not require price parameter, executed at market price after trigger - Key feature
}

5. Trailing Order#

When selecting "Trailing Order" in the Binance APP, the corresponding API parameters are:

Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "SELL",               // Required: Buy/Sell direction
  "type": "TRAILING_STOP_MARKET", // Required: Order type - Key parameter
  "quantity": "0.1",            // Required: Order quantity
  "activationPrice": "3500.00", // Required: Activation price - Key parameter
  "callbackRate": "1.0",        // Required: Callback rate (1.0=1%) - Key parameter
  
  // Optional parameters
  "workingType": "CONTRACT_PRICE", // Price type: mark price/latest contract price
  "positionSide": "BOTH",       // Position direction
  "newClientOrderId": "my_trailing_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Note: Trailing orders do not require price and stopPrice parameters - Key feature
  // Activation condition: The sell order's activationPrice must be greater than the current price
}

6. Only Maker#

When selecting "Only Maker" in the Binance APP, the corresponding API parameters are:

Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "LIMIT",              // Required: Order type
  "timeInForce": "GTX",         // Required: Valid time - Key parameter (must be GTX)
  "quantity": "0.1",            // Required: Order quantity
  "price": "3450.00",           // Required: Order price
  
  // Optional parameters
  "positionSide": "BOTH",       // Position direction (default BOTH in single position)
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_gtx_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Key feature: If the order will be immediately filled (becoming a taker), the system will reject the order
  // Ensure to only provide liquidity and enjoy Maker fees
}

7. Conditional Order#

Conditional orders are a general term for STOP and TAKE_PROFIT type orders; please refer to the "Limit Stop Loss/Take Profit" and "Market Stop Loss/Take Profit" sections for detailed parameters.

Key Features of Conditional Orders:

  • Includes: STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET
  • All have stopPrice trigger price - Key parameter
  • Can choose limit or market execution
  • Support workingType (trigger condition) and priceProtect (price protection) parameters
  • Only activated when the trigger condition is met

8. Time-weighted Order (TWAP)#

When selecting "Time-weighted Order" in the Binance APP, the corresponding API parameters are:

Complete Parameter Example:

{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "LIMIT",              // Required: Order type
  "timeInForce": "GTD",         // Required: Valid time - Key parameter (must be GTD)
  "quantity": "0.1",            // Required: Order quantity
  "price": "3450.00",           // Required: Order price
  "goodTillDate": 1640995200000, // Required: Expiration timestamp - Key parameter
  
  // Optional parameters
  "positionSide": "BOTH",       // Position direction (default BOTH in single position)
  "reduceOnly": false,          // Whether to only reduce position
  "newClientOrderId": "my_twap_001", // Custom order ID
  "newOrderRespType": "ACK"     // Response type
  
  // Key feature: The system will split large orders into multiple small market orders
  // Execute in batches over a specified time period to achieve time-weighted average price
}

9. Segmented Orders#

Segmented orders are not a single API parameter but a combination of multiple orders:

Implementation Method:

  • Split large orders into multiple small orders
  • Each small order is placed independently
  • Can be a combination of limit orders at different prices
  • Or a sequence of orders executed over time

Complete Parameter Example (Multiple Independent Orders):

// Order 1 - Higher Price
{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "LIMIT",              // Required: Order type
  "timeInForce": "GTC",         // Required: Valid time
  "quantity": "0.05",           // Required: Order quantity
  "price": "3450.00",           // Required: Order price - Key parameter
  "newClientOrderId": "batch_001_1" // Custom order ID
}

// Order 2 - Lower Price
{
  "symbol": "ETHUSDT",           // Required: Trading pair
  "side": "BUY",                // Required: Buy/Sell direction
  "type": "LIMIT",              // Required: Order type
  "timeInForce": "GTC",         // Required: Valid time
  "quantity": "0.05",           // Required: Order quantity
  "price": "3440.00",           // Required: Order price - Key parameter
  "newClientOrderId": "batch_001_2" // Custom order ID
}

// Key feature: Achieve layered buying/selling strategies through multiple orders at different prices

Summary of Parameter Dependencies#

  • LIMIT type: Must provide price
  • MARKET type: Does not require price parameter
  • STOP/TAKE_PROFIT type: Requires price and stopPrice
  • STOP_MARKET/TAKE_PROFIT_MARKET type: Only requires stopPrice
  • TRAILING_STOP_MARKET type: Requires activationPrice and callbackRate
  • Most order types require quantity
  • STOP_MARKET/TAKE_PROFIT_MARKET can use closePosition=true instead
  • TRAILING_STOP_MARKET does not require explicit quantity specification

Time Validity Parameters#

  • LIMIT orders: Must specify timeInForce
  • STOP/TAKE_PROFIT orders: Optional timeInForce, default GTC
  • Other order types: Usually do not require this parameter

Notes#

Maker and Taker Judgment Rules#

Many people mistakenly believe that order type determines the Maker/Taker role; in fact:

Key Judgment Standard:

  • Whether the order immediately fills existing orders on the order book, not the order type itself

Market Orders:

  • Usually Taker: Because market orders will immediately execute at the current best price
  • Very Few Exceptions: In extreme liquidity shortages, market orders may partially become Makers

Limit Orders:

  • May be Maker: If the limit order price cannot be filled immediately, it will hang on the order book waiting
  • May also be Taker: If the limit order price can immediately match existing orders

Specific Example:

Limit Order as Taker:

  • Current sell price: 50,000 USDT
  • You place a limit buy order: 50,000 USDT (immediately filled)
  • Result: Your limit order is a Taker

Limit Order as Maker:

  • Current sell price: 50,000 USDT
  • You place a limit buy order: 49,950 USDT (cannot be filled immediately)
  • Result: Your limit order hangs on the order book, becoming a Maker

Market Order as Taker (Common):

  • You place a market buy order
  • Immediately fills at the current best sell price
  • Result: You are a Taker

Impact on selfTradePreventionMode:

  • The system will apply protection rules based on the actual Maker/Taker roles
  • Not based on order type, but on the final transaction role

How to Ensure Being a Maker#

Since Makers enjoy lower fees, many traders want to ensure their orders become Makers:

1. Use timeInForce=GTX

  • GTX (Good Till Crossing): Passive order, only acts as Maker
  • If the order will be immediately filled (becoming a Taker), the system will directly reject the order
  • This is the most direct and safest method

2. Price Strategy

  • Buy Order: Set price below the current best buy price
  • Sell Order: Set price above the current best sell price
  • This way, the order will hang on the order book waiting to be filled

3. Use priceMatch Queue Price

  • QUEUE: Queue price (buy/sell price)
  • QUEUE_5/10/20: Slightly optimize based on queue price
  • Although not a 100% guarantee, it is likely to become a Maker

Actual Example:
Assuming current BTCUSDT: Best Buy Price 49,950, Best Sell Price 50,000

Ensuring to be a Maker Order:

// Buy Order as Maker
{
  "side": "BUY",
  "price": "49,940",  // Below best buy price
  "timeInForce": "GTX"
}

// Sell Order as Maker  
{
  "side": "SELL",
  "price": "50,010",  // Above best sell price
  "timeInForce": "GTX"
}

Safest Combination:
Using timeInForce=GTX + Appropriate Price Strategy, this way even if the price judgment is wrong, the system will reject the order instead of accidentally becoming a Taker.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.