adding accounts to multiplex on the fly
I am still very new at python or any other coding language so if this is an obvious answer and I just don't know what to look for to find it, I apologize. I was wondering if it is possible to add streams to the multiplex socket on the fly? If I make a trade and want more info on the pair I am holding, do I have to restart the multiplex stream each time or is there a way to add the pair I just acquired to the existing stream? Also can I drop info I am recieving on a pair while continuing to receive info for other pairs? Thanks
You could do something like this listening to the user socket for trades and opening up a socket on trade if thats what you're looking for
def handle_account_socket( m):
if m['e'] == 'executionReport':
symbol = m["s"].lower()
conn_key = bm.start_multiplex_socket([symbol+'@ticker', symbol'@depth'], process_m_message)
Great! Thank you for letting me know how to do this. I have only been messing with python for about a month and have taken a semester of Java and a semester of matlab, so I still don't even know what I don't know.