关于二进制API

2024-09-27 21:26:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用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'}

附言:我现在有一个空缺职位。这是一个长的位置


Tags: falsesymbolcrossbothunrealizedprofitleverageentrypricepositionamt

热门问题