Unable to obtain livefeed from Alice Blue broker

below code for obtaining live feed:

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', 'INFY'), LiveFeedType.MARKET_DATA)
sleep(10)

Below error message:

ile "C:\ProgramData\Python\lib\site-packages\alice_blue\alice_blue.py", line 495, in start_websocket



self.__websocket = websocket.WebSocketApp(url,)   

init() got an unexpected keyword argument 'on_data' #404

Hi Vibha,



This error seems to be related to the WebSocket. I am providing you with a link where a similar problem has been discussed before: Unable to get live market feeds · Issue #187 · krishnavelu/alice_blue · GitHub



If this doesn't help then I suggest you ask your query to Alice Blue broker directly. Their contact details are listed on this page: Alice Blue Contact Us - We are Just One Call/Email Away!



Hope this helps!

Thanks