sammchardy / python-binance

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

websocket's interval is not changed. how to fix it ? #1148

Open tjddnjs124 opened 2 years ago

tjddnjs124 commented 2 years ago

depth cache manager using threads dcm = ThreadedDepthCacheManager() dcm.start() def handle_socket_message(msg): print(f"message type: {msg['e']}") print(msg) def handle_dcm_message(depth_cache): print(f"symbol {depth_cache.symbol}") print("top 5 bids") print(depth_cache.get_bids()[:5]) print("top 5 asks") print(depth_cache.get_asks()[:5]) print("last update time {}".format(depth_cache.update_time)) twm.start_kline_socket(callback=handle_socket_message, symbol='BNBBTC') dcm.start_depth_cache(callback=handle_dcm_message, symbol='ETHBTC') # replace with a current options symbol options_symbol = 'BTC-210430-36000-C' dcm.start_options_depth_cache(callback=handle_dcm_message, symbol=options_symbol) # join the threaded managers to the main thread twm.join() dcm.join()

i used this code, it is not change the interval ( now interval is 1 second. i want to change it live data.) how to fix it to loas live streamimg ? thank you.

oliver-zehentleitner commented 2 years ago

here it works: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-local-depth-cache