LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
685 stars 165 forks source link

Monitor Orders #129

Closed ShayanFiroozi closed 3 years ago

ShayanFiroozi commented 3 years ago

Hi, How can i use his library to call a callback function when an order is created/removed or etc.... Thank you.

oliver-zehentleitner commented 3 years ago

I would create a loop (thread) and check the stream_buffer. But you made it bold, so here is your answer:

  1. create a callback function like this one: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_process_streams.py

  2. use it: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api/unicorn_binance_websocket_api.html?highlight=process_stream_data

ShayanFiroozi commented 3 years ago

I would create a loop (thread) and check the stream_buffer. But you made it bold, so here is your answer:

  1. create a callback function like this one: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_process_streams.py
  2. use it: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api/unicorn_binance_websocket_api.html?highlight=process_stream_data

Thank you , you are the man !👍