I am looking for a way to monitor the status of an order in Binance.
I was following the instructions here: https://readthedocs.org/projects/python-binance/downloads/pdf/latest/
I have used the following :
- #conn_key = bm.start_isolated_margin_socket('BTCUSDT', process_message)
- #conn_key = bm.start_user_socket(process_message)
- #conn_key = bm.start_margin_socket(process_message)
Of the 3 above, only #2 returns data on the TESTNET and on PRODUCTION
The other 2 do not return data on the TESTNET. I get the following error: Traceback (most recent call last): File "bin_websockets.py", line 68, in conn_key = bm.start_isolated_margin_socket('BTCUSDT', process_message) AttributeError: 'BinanceSocketManager' object has no attribute 'start_isolated_margin_socket'
I would like to run this on the TESTNET and PRODUCTION.
Again, I am seeking a way to find the status of an Order. What can I use to accomplish this task?
PUBLIC = FUTURES_LD_API_KEY
SECRET = FUTURES_LD_API_SECRET
# Instantiate a Client
client = Client(api_key=PUBLIC, api_secret=SECRET)
# Instantiate a BinanceSocketManager, passing in the client that you instantiated
bm = BinanceSocketManager(client)
# This is our callback function. For now, it just prints messages as they come.
def process_message(msg):
print(msg)
# Start trade socket with 'ETHBTC' and use handle_message to.. handle the message.
#conn_key = bm.start_trade_socket('BTCUSDT', process_message)
#conn_key = bm.start_isolated_margin_socket('BTCUSDT', process_message)
conn_key = bm.start_user_socket(process_message)
#conn_key = bm.start_margin_socket(process_message)
# then start the socket manager
bm.start()
# let some data flow..
time.sleep(10)
# stop the socket manager
bm.stop_socket(conn_key)