Reputation: 751
I have a Python script to get past trades, gives me the order info but I'm looking to get data for a closed position, like closed price, leverage entry etc., and as a bonus if available PnL.
Here is the Python script to get my trades:
import ccxt
import json
import sys
key = 'key'
secret = 'secret'
password = 'password'
symbol = 'BTC/USDT:USDT'
ku = ccxt.kucoinfutures({
'adjustForTimeDifference': True,
'apiKey': key,
'secret': secret,
'password': password,
'enableRateLimit': True,
})
# Call the API to get all trades
all_trades = ku.fetch_my_trades(symbol)
#show all trades but doesn't include the closed order data
print(all_trades)
I've gone through the ccxt docs but don't see anything about the data about the trades closed price or other relevant data.
Upvotes: 1
Views: 272