Hi,
I want to get the SL and TP values after I create an order and it waits for the buy price I set earlier.
Is there a way to get those values using python-binance lib?
Spot: Binance API Documentation
Futures: Binance API Documentation
The details of the order will be returned from this endpoint. Not sure which function to call for this library.
I couldn’t add screens before because of the new user status.
I tried this but got binance.exceptions.BinanceAPIException: APIError(code=-2013): Order does not exist.
error. It seems that while TP and SL are pending, we can’t get these values. I hope I’m wrong.
Ensure that you are using the futures endpoint if you are trading futures and not the spot one.
I forgot to add one parameter
returned data for opened futures order:
orderId 123
symbol XLMUSDT
status NEW
clientOrderId ios_st_xyz
price 0.09000
avgPrice 0.00000
origQty 166
executedQty 0
cumQuote 0
timeInForce GTC
type LIMIT
reduceOnly False
closePosition False
side BUY
positionSide LONG
stopPrice 0
workingType CONTRACT_PRICE
priceProtect False
origType LIMIT
time 12354364574567
updateTime 2536475685678
As you can see there is no info about sl and tp values.