Get trades for a specific account and symbol.
Either symbol or pair must be sent
Symbol and pair cannot be sent together
Pair and fromId cannot be sent together
OrderId can only be sent together with symbol
If a pair is sent,tickers for all symbols of the pair will be returned
The parameter fromId
cannot be sent with startTime
or endTime
If startTime and endTime are both not sent, then the last 7 days' data will be returned.
The time between startTime and endTime cannot be longer than 7 days.
Weight: 20 with symbol,40 with pair
Request parameters.
Get all account orders; active, canceled, or filled.
These orders will not be found: order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time order create time + 90 days < current time
Either symbol
or pair
must be sent.
pair
can't be sent with orderId
If orderId
is set, it will get orders >= that orderId
. Otherwise most recent orders are returned.
If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
The query time period must be less then 7 days( default as the recent 7 days).
Weight: 20 with symbol, 40 with pair
Request parameters.
Cancel all open orders of the specified symbol at the end of the specified countdown. This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. The system will check all countdowns approximately every 10 milliseconds, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.
Example usage: Call this endpoint at 30s intervals with an countdownTime of 120000 (120s). If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.
Weight: 10
Request parameters.
Cancel All Open Orders
Weight: 1
Request parameters.
Cancel Multiple Orders
Either orderIdList
or origClientOrderIdList
must be sent.
Weight: 1
Request parameters.
Cancel an active order.
Either orderId
or origClientOrderId
must be sent.
Weight: 1
Request parameters.
Change user's initial leverage in the specific symbol market. For Hedge Mode, LONG and SHORT positions of one symbol use the same initial leverage and share a total notional value.
Weight: 1
Request parameters.
Change user's margin type in the specific symbol market.For Hedge Mode, LONG and SHORT positions of one symbol use the same margin type. With ISOLATED margin type, margins of the LONG and SHORT positions are isolated from each other.
Weight: 1
Request parameters.
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight: 1
Request parameters.
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 1 for a single symbol, 40 for mutltiple symbols
Request parameters.
Get order modification history
Either orderId
or origClientOrderId
must be sent, and the orderId
will prevail if both are sent.
Order modify history longer than 3 month is not avaliable
Weight: 1
Request parameters.
Get position margin change history
Weight: 1
Request parameters.
Modify Isolated Position Margin
Only for isolated symbol
Weight: 1
Request parameters.
Modify Multiple Orders
Parameter rules are same with Modify Order
Batch modify orders are processed concurrently, and the order of matching is not guaranteed.
The order of returned contents for batch modify orders is the same as the order of the order list.
One order can only be modfied for less than 10000 times
Weight: 5
Request parameters.
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
Either orderId
or origClientOrderId
must be sent, and the orderId
will prevail if both are sent.
Either quantity
or price
must be sent.
When the new quantity
or price
doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
However the order will be cancelled by the amendment in the following situations:
when the order is in partially filled status and the new quantity
<= executedQty
When the order is GTX
and the new price will cause it to be executed immediately
One order can only be modfied for less than 10000 times
Weight: 1
Request parameters.
Send in a new order.
Order with type STOP
, parameter timeInForce
can be sent ( default GTC
).
Order with type TAKE_PROFIT
, parameter timeInForce
can be sent ( default GTC
).
Condition orders will be triggered when:
If parameterpriceProtect
is sent as true:
when price reaches the stopPrice
,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
"triggerProtect" of a symbol can be got from GET /dapi/v1/exchangeInfo
STOP
, STOP_MARKET
:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
TAKE_PROFIT
, TAKE_PROFIT_MARKET
:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
TRAILING_STOP_MARKET
:
BUY: the lowest price after order placed <=
activationPrice, and the latest price >
= the lowest price * (1 + callbackRate
)
SELL: the highest price after order placed >= activationPrice
, and the latest price <= the highest price * (1 - callbackRate
)
For TRAILING_STOP_MARKET
, if you got such error code.
{"code": -2021, "msg": "Order would immediately trigger."}
means that the parameters you send do not meet the following requirements:
BUY: activationPrice
should be smaller than latest price.
SELL: activationPrice
should be larger than latest price.
If newOrderRespType
is sent as RESULT
:
MARKET
order: the final FILLED result of the order will be return directly.
LIMIT
order with special timeInForce
: the final status result of the order(FILLED or EXPIRED) will be returned directly.
STOP_MARKET
, TAKE_PROFIT_MARKET
with closePosition
=true
:
Follow the same rules for condition orders.
If triggered,close all current long position( if SELL
) or current short position( if BUY
).
Cannot be used with quantity
parameter
Cannot be used with reduceOnly
parameter
In Hedge Mode,cannot be used with BUY
orders in LONG
position side. and cannot be used with SELL
orders in SHORT
position side
selfTradePreventionMode
is only effective when timeInForce
set to IOC
or GTC
.
Weight: 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M)
0 on IP rate limit(x-mbx-used-weight-1m)
Request parameters.
Query position ADL quantile estimation
Values update every 30s. Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high. For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, "LONG", "SHORT", and "BOTH" will be returned to show the positions' adl quantiles of different position sides. If the positions of the symbol are crossed margined in Hedge Mode: "HEDGE" as a sign will be returned instead of "BOTH"; A same value caculated on unrealized pnls on long and short sides' positions will be shown for "LONG" and "SHORT" when there are positions in both of long and short sides.
Weight: 5
Request parameters.
Get current account information.
If neither marginAsset
nor pair
is sent, positions of all symbols with TRADING
status will be returned.
for One-way Mode user, the response will only show the "BOTH" positions
for Hedge Mode user, the response will show "BOTH", "LONG", and "SHORT" positions.
Please use with user data stream ACCOUNT_UPDATE
to meet your timeliness and accuracy needs.
Weight: 1
Request parameters.
Query Current Open Order
EitherorderId
or origClientOrderId
must be sent
If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.
Weight: 1
Request parameters.
Check an order's status.
These orders will not be found: order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time order create time + 90 days < current time
Either orderId
or origClientOrderId
must be sent.
Weight: 1
Request parameters.
User's Force Orders
If "autoCloseType" is not sent, orders with both of the types will be returned If "startTime" is not sent, data within 200 days before "endTime" can be queried
Weight: 20 with symbol, 50 without symbol
Request parameters.
TradeApi - object-oriented interface TradeApi