sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.88k stars 2.2k forks source link

Futures #1162

Open eduardomaas82 opened 2 years ago

eduardomaas82 commented 2 years ago

It is not listing open trades in futures.

client.futures_get_open_orders()

mhawry commented 2 years ago

That endpoint will only list open orders, not trades.

To view your open positions you need to use the following and filter by symbol:

client.futures_position_information()

eduardomaas82 commented 2 years ago

To cancel the order, I could not. what procedure to search ID and cancel the order?

mhawry commented 2 years ago

You can view your open orders with the following:

client.futures_get_open_orders()

You can also filter by symbol:

client.futures_get_open_orders(symbol='BTCUSDT')

These will return the orderId which you can then use to cancel the order. Both the symbol and orderId parameters are required (replace orderId with the value that was returned by the previous endpoint):

client.futures_cancel_order(symbol='BTCUSDT', orderId=orderId)