How to fetch market data using alice-blue python wrapper?

Hi Everyone,

I am just trying to use alice-blue python wrapper to get live market data using the blow example. I am just curious why I only get one quote !!?? Shouldn’t it keep printing live data as it becomes available?

Please let me know.
Regards,

socket_opened = False

def event_handler_quote_update(message):
print(f"quote update {message}")

def open_callback():
global socket_opened
socket_opened = True

alice.start_websocket(subscribe_callback=event_handler_quote_update,
socket_open_callback=open_callback,
run_in_background=True)
while(socket_opened==False):
pass
alice.subscribe(alice.get_instrument_by_symbol(‘NSE’, ‘ONGC’), LiveFeedType.MARKET_DATA)
sleep(10)

If You’re married to one girl, You will only see one wife.

You are subbing only ONGC. So you will get only ONGC. Right? Sub more symbols :slight_smile: