<jupyter_start><jupyter_text>Streaming market data ver 1<jupyter_code>def stream_data(msg):
    '''define how to process incoming websocket message'''
    print(msg)
# initialize and start the websocket
twm = ThreadedWebsocketManager()
twm.start()
twm<jupyter_output><empty_output><jupyter_text>Indiviual mini ticker stream24hr rolling window mini ticker statistics. these are not of UTC day, but a 24hr rolling window for previous 24hr<jupyter_code>#subscribe to the stream
twm.start_symbol_miniticker_socket(callback = stream_data, symbol = "BTCUSDT")
twm.stop()<jupyter_output>{'e': '24hrMiniTicker', 'E': 1643787611470, 's': 'BTCUSDT', 'c': '38292.93000000', 'o': '38445.07000000', 'h': '39265.20000000', 'l': '38000.00000000', 'v': '34529.27352000', 'q': '1332951196.78380250'}
{'fraction_non_alphanumeric': 0.13682864450127877, 'fraction_numerical': 0.13427109974424553, 'mean_word_length': 7.510869565217392, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '599264', 'license': 'MIT', 'n_tokens_mistral': 353, 'n_tokens_neox': 283, 'n_words': 70, 'path': '5. Streaming market data ver 1.ipynb', 'repo_name': 'seamonsterlab/initial_tradingbot', 'size': '782'}