milekz
milekz

Reputation: 19

ByBit API: How to get info on all positions in Copy Trading?

I have problem to fetch all positions from Copy Trade. "settleCoin" doesn't work here

...
from pybit.unified_trading import HTTP
session = HTTP(
    testnet=False,
    api_key=API_KEY,
    api_secret=API_SECRET,
)
print(session.get_positions( category="linear", settleCoin='USDT' ))
print(session.get_positions( category="linear", symbol="CKBUSDT" ))

output:

{'retCode': 0, 'retMsg': 'OK', 'result': {'list': [], 'nextPageCursor': '', 'category': 'linear'}, 'retExtInfo': {}, 'time': 1727596935232}
{'retCode': 0, 'retMsg': 'OK', 'result': {'list': [{'positionIdx': 0, 'riskId': 1, 'riskLimitValue': '100000', 'symbol': 'CKBUSDT', 'side': 'None', 'size': '0', 'avgPrice': '0', 'positionValue': '0', 'tradeMode': 0, 'positionStatus': 'Normal', 'autoAddMargin': 0, 'adlRankIndicator': 0, 'leverage': '10', 'positionBalance': '0', .....

How to get all open positions from Copy Trade ?

Upvotes: 0

Views: 252

Answers (0)

Related Questions