In order to cancel an order in binance I need an orderID.
How can I place an order and automatically receive an order ID back.
I am sending an order this way
def order_sell():
client.create_order(
symbol='XRPBNB',
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
newClientOrderId=1,
quantity=30,
price= 0.001895)
order_sell()
Order is placed correctly but I am not getting nothing in return. How can I receive and write down the response?
Without orderID i cannot cancel it later instantly and I asking binance API for all orders list to retrieve Id, but I belive it can be done in a proper way.
I am a beginner and would be grateful for answer for beginner.