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.
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.