0

我正在尝试使用 Python 了解我的未平仓头寸信息(在期货中),但我做不到。

如何使用 Binance API 找到我的头寸信息?

这是我尝试的;

from binance.client import Client
import MyAPI

Login = Client(MyAPI.KEY, MyAPI.SECRET)

myPosition = Login.futures_position_information(symbol='BTCUSDT')
print(myPosition)

和服务器响应;

[{'symbol': 'XRPUSD_210625', 'positionAmt': '0', 'entryPrice': '0.00000000', 'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '500000', 'marginType': 'cross', 'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}, {'symbol': 'LTCUSD_210625', 'positionAmt': '0', 'entryPrice': '0.00000000', 'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '2500', 'marginType': 'cross', 'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}, {'symbol': 'EOSUSD_PERP', 'positionAmt': '0', 'entryPrice': '0.00000000', 'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '10000', 'marginType': 'cross', 
'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}, {'symbol': 'LTCUSD_210924', 'positionAmt': '0', 'entryPrice': '0.00000000', 'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '2500', 'marginType': 'cross', 'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}, {'symbol': 'FILUSD_PERP', 'positionAmt': '0', 'entryPrice': '0.00000000', 
'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '5000', 'marginType': 'cross', 'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}, {'symbol': 'ADAUSD_210625', 'positionAmt': '0', 'entryPrice': '0.00000000', 'markPrice': '0.00000000', 'unRealizedProfit': '0.00000000', 'liquidationPrice': '0', 'leverage': '20', 'maxQty': '500000', 'marginType': 'cross', 'isolatedMargin': '0.00000000', 'isAutoAddMargin': 'false', 'positionSide': 'BOTH', 'notionalValue': '0', 'isolatedWallet': '0'}

PS:我现在有一个空缺职位。这是多头头寸。

4

0 回答 0