1.7 Binance_interface API U本位合约交易账户

Binance_interface API U本位合约交易账户

1. API U本位合约交易账户接口总览

方法解释Path
set_positionSide_dual更改持仓模式/fapi/v1/positionSide/dual
get_positionSide_dual查询持仓模式/fapi/v1/positionSide/dual
set_multiAssetsMargin更改联合保证金模式/fapi/v1/multiAssetsMargin
get_multiAssetsMargin查询联合保证金模式/fapi/v1/multiAssetsMargin
set_order下单/fapi/v1/order
set_order_test测试下单接口 (TRADE)/fapi/v1/order/test
alter_order修改订单/fapi/v1/order
set_batchOrders批量下单/fapi/v1/batchOrders
alter_batchOrders批量修改订单/fapi/v1/batchOrders
get_orderAmendment查询订单修改历史/fapi/v1/orderAmendment
get_order查询订单/fapi/v1/order
cancel_order撤销订单/fapi/v1/order
cancel_allOpenOrders撤销全部订单/fapi/v1/allOpenOrders
cancel_batchOrders批量撤销订单/fapi/v1/batchOrders
set_countdownCancelAll倒计时撤销所有订单/fapi/v1/countdownCancelAll
get_openOrder查询当前挂单/fapi/v1/openOrder
get_openOrders查看当前全部挂单/fapi/v1/openOrders
get_allOrders查询所有订单(包括历史订单)/fapi/v1/allOrders
get_balance账户余额V2/fapi/v2/balance
get_account账户信息V2/fapi/v2/account
set_leverage调整开仓杠杆/fapi/v1/leverage
set_marginType变换逐全仓模式/fapi/v1/marginType
set_positionMargin调整逐仓保证金/fapi/v1/positionMargin
get_positionMargin_history逐仓保证金变动历史/fapi/v1/positionMargin/history
get_positionRisk用户持仓风险V2/fapi/v2/positionRisk
get_userTrades账户成交历史/fapi/v1/userTrades
get_income获取账户损益资金流水/fapi/v1/income
get_leverageBracket杠杆分层标准/fapi/v1/leverageBracket
get_adlQuantile持仓ADL队列估算/fapi/v1/adlQuantile
get_forceOrders用户强平单历史/fapi/v1/forceOrders
get_apiTradingStatus合约交易量化规则指标/fapi/v1/apiTradingStatus
get_commissionRate用户手续费率/fapi/v1/commissionRate
get_income_asyn获取合约资金流水下载Id/fapi/v1/income/asyn
get_income_asyn_id通过下载Id获取合约资金流水下载链接/fapi/v1/income/asyn/id
get_order_asyn获取合约订单历史下载Id/fapi/v1/order/asyn
get_order_asyn_id通过下载Id获取合约订单下载链接/fapi/v1/order/asyn/id
get_trade_asyn获取合约交易历史下载Id/fapi/v1/trade/asyn
get_trade_asyn_id通过下载Id获取合约交易历史下载链接/fapi/v1/trade/asyn/id

2. 模型实例化

from binance_interface.api import UM
from binance_interface.app.utils import eprint
# 转发:需搭建转发服务器,可参考:https://github.com/pyted/binance_resender
proxy_host = None
key = 'xxxx'
secret = 'xxxx'

um = UM(
    key=key, secret=secret,
    proxy_host=proxy_host
)
accountTrade = um.accountTrade

3. 账户相关

3.1 账户余额V2 get_balance

balance_result = accountTrade.get_balance()
eprint(balance_result)

输出:

>>> {'code': 200,
>>>  'data': [{'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'BTC',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'XRP',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'TUSD',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'BNB',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'ETH',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'USDT',
>>>            'balance': '98.36687032',
>>>            'crossWalletBalance': '98.36687032',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'USDP',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'},
>>>           {'accountAlias': 'SguXuXmYSgTiSgfW',
>>>            'asset': 'USDC',
>>>            'balance': '0.00000000',
>>>            'crossWalletBalance': '0.00000000',
>>>            'crossUnPnl': '0.00000000',
>>>            '...': '......'}],
>>>  'msg': ''}

3.2 账户信息V2 get_account

account_result = accountTrade.get_account()
eprint(account_result)

输出:

>>> {'code': 200,
>>>  'data': {'feeTier': 0,
>>>           'canTrade': True,
>>>           'canDeposit': True,
>>>           'canWithdraw': True,
>>>           'tradeGroupId': -1,
>>>           'updateTime': 0,
>>>           'multiAssetsMargin': False,
>>>           'totalInitialMargin': '0.00000000',
>>>           'totalMaintMargin': '0.00000000',
>>>           'totalWalletBalance': '98.36687032',
>>>           'totalUnrealizedProfit': '0.00000000',
>>>           'totalMarginBalance': '98.36687032',
>>>           'totalPositionInitialMargin': '0.00000000',
>>>           'totalOpenOrderInitialMargin': '0.00000000',
>>>           'totalCrossWalletBalance': '98.36687032',
>>>           'totalCrossUnPnl': '0.00000000',
>>>           'availableBalance': '98.36687032',
>>>           'maxWithdrawAmount': '98.36687032',
>>>           'assets': [{'asset': 'BTC',
>>>                       'walletBalance': '0.00000000',
>>>                       'unrealizedProfit': '0.00000000',
>>>                       'marginBalance': '0.00000000',
>>>                       'maintMargin': '0.00000000',
>>>                       '...': '......'},
>>>                      {'asset': 'XRP',
>>>                       'walletBalance': '0.00000000',
>>>                       'unrealizedProfit': '0.00000000',
>>>                       'marginBalance': '0.00000000',
>>>                       'maintMargin': '0.00000000',
>>>                       '...': '......'},
>>>                      {'asset': 'TUSD',
>>>                       'walletBalance': '0.00000000',
>>>                       'unrealizedProfit': '0.00000000',
>>>                       'marginBalance': '0.00000000',
>>>                       'maintMargin': '0.00000000',
>>>                       '...': '......'},
>>>                      {'asset': 'BNB',
>>>                       'walletBalance': '0.00000000',
>>>                       'unrealizedProfit': '0.00000000',
>>>                       'marginBalance': '0.00000000',
>>>                       'maintMargin': '0.00000000',
>>>                       '...': '......'},
>>>                      {'asset': 'ETH',
>>>                       'walletBalance': '0.00000000',
>>>                       'unrealizedProfit': '0.00000000',
>>>                       'marginBalance': '0.00000000',
>>>                       'maintMargin': '0.00000000',
>>>                       '...': '......'},
>>>                      '......'],
>>>           'positions': [{'symbol': 'SNTUSDT',
>>>                          'initialMargin': '0',
>>>                          'maintMargin': '0',
>>>                          'unrealizedProfit': '0.00000000',
>>>                          'positionInitialMargin': '0',
>>>                          '...': '......'},
>>>                         {'symbol': 'SNTUSDT',
>>>                          'initialMargin': '0',
>>>                          'maintMargin': '0',
>>>                          'unrealizedProfit': '0.00000000',
>>>                          'positionInitialMargin': '0',
>>>                          '...': '......'},
>>>                         {'symbol': 'SUSHIUSDT',
>>>                          'initialMargin': '0',
>>>                          'maintMargin': '0',
>>>                          'unrealizedProfit': '0.00000000',
>>>                          'positionInitialMargin': '0',
>>>                          '...': '......'},
>>>                         {'symbol': 'SUSHIUSDT',
>>>                          'initialMargin': '0',
>>>                          'maintMargin': '0',
>>>                          'unrealizedProfit': '0.00000000',
>>>                          'positionInitialMargin': '0',
>>>                          '...': '......'},
>>>                         {'symbol': 'BTSUSDT',
>>>                          'initialMargin': '0',
>>>                          'maintMargin': '0',
>>>                          'unrealizedProfit': '0.00000000',
>>>                          'positionInitialMargin': '0',
>>>                          '...': '......'},
>>>                         '......']},
>>>  'msg': ''}

3.3 用户手续费率 get_commissionRate

commissionRate_result = accountTrade.get_commissionRate(symbol='MANAUSDT')
eprint(commissionRate_result)

输出:

>>> {'code': 200,
>>>  'data': {'symbol': 'MANAUSDT', 'makerCommissionRate': '0.000200', 'takerCommissionRate': '0.000500'},
>>>  'msg': ''}

3.4 账户成交历史 get_userTrades

userTrade_result = accountTrade.get_userTrades(symbol='MANAUSDT')
eprint(userTrade_result, data_length=5)

输出:

>>> {'code': 200,
>>>  'data': [{'symbol': 'MANAUSDT',
>>>            'id': 483783770,
>>>            'orderId': 10483040021,
>>>            'side': 'BUY',
>>>            'price': '0.4742',
>>>            '...': '......'},
>>>           {'symbol': 'MANAUSDT',
>>>            'id': 483848645,
>>>            'orderId': 10484723637,
>>>            'side': 'BUY',
>>>            'price': '0.4798',
>>>            '...': '......'},
>>>           {'symbol': 'MANAUSDT',
>>>            'id': 483859726,
>>>            'orderId': 10485084149,
>>>            'side': 'BUY',
>>>            'price': '0.4845',
>>>            '...': '......'},
>>>           {'symbol': 'MANAUSDT',
>>>            'id': 483859777,
>>>            'orderId': 10485085711,
>>>            'side': 'BUY',
>>>            'price': '0.4843',
>>>            '...': '......'},
>>>           {'symbol': 'MANAUSDT',
>>>            'id': 483859823,
>>>            'orderId': 10485087594,
>>>            'side': 'BUY',
>>>            'price': '0.4843',
>>>            '...': '......'},
>>>           '......'],
>>>  'msg': ''}

4. 持仓与杠杆

4.1 更改持仓模式 set_positionSide_dual

# "true": 双向持仓模式;"false": 单向持仓模式
# 如果已经是该持仓模式,返回:{'code': -4059, 'msg': 'No need to change position side.'}
accountTrade.set_positionSide_dual(dualSidePosition=True)

输出:

>>> {'code': -4059, 'msg': 'No need to change position side.'}

4.2 查询持仓模式 get_positionSide_dual

accountTrade.get_positionSide_dual()

输出:

>>> {'code': 200, 'data': {'dualSidePosition': True}, 'msg': ''}

4.3 变换逐全仓模式 set_marginType

# 保证金模式 ISOLATED(逐仓), CROSSED(全仓)
# 如果已经是该模式,返回{'code': -4046, 'msg': 'No need to change margin type.'}
accountTrade.set_marginType(symbol='MANAUSDT', marginType='ISOLATED')

输出:

>>> {'code': -4046, 'msg': 'No need to change margin type.'}

4.4 调整开仓杠杆 set_leverage

set_leverage_result = accountTrade.set_leverage(symbol='MANAUSDT', leverage=1)
eprint(set_leverage_result)

输出:

>>> {'code': 200, 'data': {'symbol': 'MANAUSDT', 'leverage': 1, 'maxNotionalValue': '10000000'}, 'msg': ''}

5. 交易与订单

5.1 下单 set_order

5.1.1 限单价开仓
# 开多
set_order_result = accountTrade.set_order(
    symbol='MANAUSDT',
    price='0.4',
    quantity='15',
    side='BUY',
    type='LIMIT',
    timeInForce='GTC',
    positionSide='LONG',
)
eprint(set_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518283927,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'LfDRA0odbXwy559agURLiU',
>>>           'price': '0.4000',
>>>           'avgPrice': '0.00',
>>>           'origQty': '15',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'LIMIT',
>>>           'reduceOnly': False,
>>>           'closePosition': False,
>>>           'side': 'BUY',
>>>           'positionSide': 'LONG',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'LIMIT',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706245923758},
>>>  'msg': ''}
5.1.2 市单价开仓
# 开空
set_order_result = accountTrade.set_order(
    symbol='MANAUSDT',
    quantity='15',
    side='SELL',
    type='MARKET',
    positionSide='SHORT',
)
eprint(set_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518286864,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'w88GuTXAZy5LB2KDhAJdD2',
>>>           'price': '0.0000',
>>>           'avgPrice': '0.00',
>>>           'origQty': '15',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'MARKET',
>>>           'reduceOnly': False,
>>>           'closePosition': False,
>>>           'side': 'SELL',
>>>           'positionSide': 'SHORT',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'MARKET',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706245988691},
>>>  'msg': ''}
5.1.3 限单价平仓
# 平多
set_order_result = accountTrade.set_order(
    symbol='MANAUSDT',
    price='1',
    quantity='12',
    side='SELL',
    type='LIMIT',
    timeInForce='GTC',
    positionSide='LONG',
)
eprint(set_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518287024,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'PQ5ysCRUEYDaejOrKph9ot',
>>>           'price': '1.0000',
>>>           'avgPrice': '0.00',
>>>           'origQty': '12',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'LIMIT',
>>>           'reduceOnly': True,
>>>           'closePosition': False,
>>>           'side': 'SELL',
>>>           'positionSide': 'LONG',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'LIMIT',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706245995585},
>>>  'msg': ''}
5.1.4 市单价平仓
# 平空
set_order_result = accountTrade.set_order(
    symbol='MANAUSDT',
    quantity='10',
    side='BUY',
    type='MARKET',
    positionSide='SHORT',
)
eprint(set_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518287813,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'FeGIIggMT0F8R6XPVN7oVQ',
>>>           'price': '0.0000',
>>>           'avgPrice': '0.00',
>>>           'origQty': '10',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'MARKET',
>>>           'reduceOnly': True,
>>>           'closePosition': False,
>>>           'side': 'BUY',
>>>           'positionSide': 'SHORT',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'MARKET',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706246012223},
>>>  'msg': ''}

5.2 当前挂单 get_openOrders

openOrderList_result = accountTrade.get_openOrders(symbol='MANAUSDT')
eprint(openOrderList_result,length=20)

输出:

>>> {'code': 200,
>>>  'data': [{'orderId': 10518287024,
>>>            'symbol': 'MANAUSDT',
>>>            'status': 'NEW',
>>>            'clientOrderId': 'PQ5ysCRUEYDaejOrKph9ot',
>>>            'price': '1',
>>>            'avgPrice': '0',
>>>            'origQty': '12',
>>>            'executedQty': '0',
>>>            'cumQuote': '0.0000',
>>>            'timeInForce': 'GTC',
>>>            'type': 'LIMIT',
>>>            'reduceOnly': True,
>>>            'closePosition': False,
>>>            'side': 'SELL',
>>>            'positionSide': 'LONG',
>>>            'stopPrice': '0',
>>>            'workingType': 'CONTRACT_PRICE',
>>>            'priceProtect': False,
>>>            'origType': 'LIMIT',
>>>            'priceMatch': 'NONE',
>>>            '...': '......'},
>>>           {'orderId': 10518283927,
>>>            'symbol': 'MANAUSDT',
>>>            'status': 'NEW',
>>>            'clientOrderId': 'LfDRA0odbXwy559agURLiU',
>>>            'price': '0.4000',
>>>            'avgPrice': '0',
>>>            'origQty': '15',
>>>            'executedQty': '0',
>>>            'cumQuote': '0.0000',
>>>            'timeInForce': 'GTC',
>>>            'type': 'LIMIT',
>>>            'reduceOnly': False,
>>>            'closePosition': False,
>>>            'side': 'BUY',
>>>            'positionSide': 'LONG',
>>>            'stopPrice': '0',
>>>            'workingType': 'CONTRACT_PRICE',
>>>            'priceProtect': False,
>>>            'origType': 'LIMIT',
>>>            'priceMatch': 'NONE',
>>>            '...': '......'}],
>>>  'msg': ''}

5.3 查询订单 get_order

order_result = accountTrade.get_order(
    symbol='MANAUSDT',
    orderId='10518287024',
)
eprint(order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518287024,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'PQ5ysCRUEYDaejOrKph9ot',
>>>           'price': '1.0000',
>>>           'avgPrice': '0.00',
>>>           'origQty': '12',
>>>           'executedQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'LIMIT',
>>>           'reduceOnly': True,
>>>           'closePosition': False,
>>>           'side': 'SELL',
>>>           'positionSide': 'LONG',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'LIMIT',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'time': 1706245995585,
>>>           'updateTime': 1706245995585},
>>>  'msg': ''}

5.4 修改订单 alter_order

alter_order_result = accountTrade.alter_order(
    symbol='MANAUSDT',
    orderId = '10518283927',
    price='0.39',
    side='BUY',
    quantity = '15',
)
eprint(alter_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518283927,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'NEW',
>>>           'clientOrderId': 'LfDRA0odbXwy559agURLiU',
>>>           'price': '0.3900',
>>>           'avgPrice': '0.00',
>>>           'origQty': '15',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'LIMIT',
>>>           'reduceOnly': False,
>>>           'closePosition': False,
>>>           'side': 'BUY',
>>>           'positionSide': 'LONG',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'LIMIT',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706246198094},
>>>  'msg': ''}

5.5 批量下单 set_batchOrders

set_batchOrders_result = accountTrade.set_batchOrders(
    batchOrders = [
        dict(symbol='MANAUSDT', price='0.4', quantity='15', side='BUY', type='LIMIT', timeInForce='GTC', positionSide='LONG',),
        dict(symbol='MANAUSDT', price='0.41', quantity='15', side='BUY', type='LIMIT', timeInForce='GTC', positionSide='LONG',),
    ]
)
eprint(set_batchOrders_result)

输出:

>>> {'code': 200,
>>>  'data': [{'orderId': 10518295761,
>>>            'symbol': 'MANAUSDT',
>>>            'status': 'NEW',
>>>            'clientOrderId': 'MLoDryB4R80vjSw0h4BNZ3',
>>>            'price': '0.4000',
>>>            '...': '......'},
>>>           {'orderId': 10518295760,
>>>            'symbol': 'MANAUSDT',
>>>            'status': 'NEW',
>>>            'clientOrderId': 'UG137zRT8db55ks4lbTPZt',
>>>            'price': '0.4100',
>>>            '...': '......'}],
>>>  'msg': ''}

5.6 撤销订单 cancel_order

cancel_order_result = accountTrade.cancel_order(
    symbol='MANAUSDT',
    orderId='10518283927'
)
eprint(cancel_order_result)

输出:

>>> {'code': 200,
>>>  'data': {'orderId': 10518283927,
>>>           'symbol': 'MANAUSDT',
>>>           'status': 'CANCELED',
>>>           'clientOrderId': 'LfDRA0odbXwy559agURLiU',
>>>           'price': '0.3900',
>>>           'avgPrice': '0.00',
>>>           'origQty': '15',
>>>           'executedQty': '0',
>>>           'cumQty': '0',
>>>           'cumQuote': '0.0000',
>>>           'timeInForce': 'GTC',
>>>           'type': 'LIMIT',
>>>           'reduceOnly': False,
>>>           'closePosition': False,
>>>           'side': 'BUY',
>>>           'positionSide': 'LONG',
>>>           'stopPrice': '0.0000',
>>>           'workingType': 'CONTRACT_PRICE',
>>>           'priceProtect': False,
>>>           'origType': 'LIMIT',
>>>           'priceMatch': 'NONE',
>>>           'selfTradePreventionMode': 'NONE',
>>>           'goodTillDate': 0,
>>>           'updateTime': 1706246225477},
>>>  'msg': ''}

5.7 撤销单一交易对的所有挂单 cancel_allOpenOrders

cancel_openOrders_result = accountTrade.cancel_allOpenOrders(symbol='MANAUSDT')
eprint(cancel_openOrders_result)

输出:

>>> {'code': 200, 'msg': 'The operation of cancel all open order is done.'}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PYTED量化交易研究所

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值