Sending live stock data to excel using xlwings

Hi!
On running the below code, I keep receiving live data from my stock broker. My objective is to update the data in to a excel sheet where I can add various conditions.
Appreciate if anybody can help we with a code which can update it in excel sheet like.

Symbol open high low etc
ACC 2210.0 2215.95 2142.05 etc

=Code=
import json
import pandas as pd
import xlwings as xw
wb = xw.Book(‘D:\python\AB.xlsm’)
sheet = wb.sheets[‘MW’]
from alice_blue import *
import time, datetime
access_token = “#####”
access_token = AliceBlue.login_and_get_access_token(username=’####’, password=’###’, twoFA=’###’, api_secret=’###’)
alice = AliceBlue(username=’###’, password=’###’, access_token=access_token)
instrument_list = [“ACC”, “ADANIENT”, “UPL”, “PNB”]
socket_opened = False
live_data = {}

def event_handler_quote_update(message):
print (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 not socket_opened:
print(“Connecting to WebSocket…”)
time.sleep(1)
pass

alice.subscribe([alice.get_instrument_by_symbol(“NSE”, i) for i in instrument_list], LiveFeedType.MARKET_DATA)
while len(live_data.keys()) != len(instrument_list):
continue
print(“Connected to web socket…”)

=output=
Connecting to WebSocket…
{‘exchange’: ‘NSE’, ‘token’: 22, ‘buyers’: [1, 2, 1, 2, 1], ‘bid_prices’: [2183.75, 2183.7, 2183.65, 2183.5, 2183.45], ‘bid_quantities’: [16, 44, 40, 6, 3], ‘sellers’: [1, 2, 2, 5, 1], ‘ask_prices’: [2184.85, 2184.9, 2184.95, 2185.0, 2185.05], ‘ask_quantities’: [13, 10, 25, 32, 4], ‘atp’: 2175.59, ‘open’: 2210.0, ‘high’: 2215.95, ‘low’: 2142.05, ‘close’: 2212.05, ‘total_buy_quantity’: 73994, ‘total_sell_quantity’: 63532, ‘volume’: 481187, ‘instrument’: Instrument(exchange=‘NSE’, token=22, symbol=‘ACC’, name=‘ACC LIMITED’, expiry=None, lot_size=None)}

{‘exchange’: ‘NSE’, ‘token’: 25, ‘buyers’: [1, 1, 3, 1, 2], ‘bid_prices’: [1521.05, 1521.0, 1520.95, 1520.9, 1520.85], ‘bid_quantities’: [6, 22, 26, 13, 25], ‘sellers’: [2, 1, 2, 1, 1], ‘ask_prices’: [1522.0, 1522.05, 1522.15, 1522.2, 1522.25], ‘ask_quantities’: [57, 25, 123, 12, 18], ‘atp’: 1527.6, ‘open’: 1545.0, ‘high’: 1551.4, ‘low’: 1494.05, ‘close’: 1543.0, ‘total_buy_quantity’: 139213, ‘total_sell_quantity’: 156076, ‘volume’: 1664636, ‘instrument’: Instrument(exchange=‘NSE’, token=25, symbol=‘ADANIENT’, name=‘ADANI ENTERPRISES LIMITED’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 11287, ‘buyers’: [1, 2, 3, 1, 2], ‘bid_prices’: [691.15, 690.9, 690.8, 690.75, 690.7], ‘bid_quantities’: [1, 15, 116, 24, 185], ‘sellers’: [5, 1, 4, 3, 4], ‘ask_prices’: [691.25, 691.35, 691.4, 691.45, 691.5], ‘ask_quantities’: [143, 20, 205, 111, 156], ‘atp’: 693.05, ‘open’: 704.0, ‘high’: 708.0, ‘low’: 686.25, ‘close’: 704.35, ‘total_buy_quantity’: 226605, ‘total_sell_quantity’: 214967, ‘volume’: 1072488, ‘instrument’: Instrument(exchange=‘NSE’, token=11287, symbol=‘UPL’, name=‘UPL LIMITED’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 10666, ‘buyers’: [15, 36, 81, 44, 88], ‘bid_prices’: [45.0, 44.95, 44.9, 44.85, 44.8], ‘bid_quantities’: [257307, 57412, 115421, 99281, 164301], ‘sellers’: [33, 136, 81, 145, 114], ‘ask_prices’: [45.05, 45.1, 45.15, 45.2, 45.25], ‘ask_quantities’: [45187, 174019, 117337, 199938, 149491], ‘atp’: 44.4, ‘open’: 44.25, ‘high’: 45.5, ‘low’: 43.15, ‘close’: 43.95, ‘total_buy_quantity’: 6776481, ‘total_sell_quantity’: 16090570, ‘volume’: 96076993, ‘instrument’: Instrument(exchange=‘NSE’, token=10666, symbol=‘PNB’, name=‘PUNJAB NATIONAL BANK’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 11287, ‘buyers’: [2, 1, 2, 2, 1], ‘bid_prices’: [690.9, 690.8, 690.75, 690.7, 690.65], ‘bid_quantities’: [15, 101, 15, 185, 15], ‘sellers’: [5, 3, 3, 4, 3], ‘ask_prices’: [691.25, 691.3, 691.35, 691.4, 691.45], ‘ask_quantities’: [142, 53, 184, 209, 111], ‘atp’: 693.05, ‘open’: 704.0, ‘high’: 708.0, ‘low’: 686.25, ‘close’: 704.35, ‘total_buy_quantity’: 226580, ‘total_sell_quantity’: 215112, ‘volume’: 1072489, ‘instrument’: Instrument(exchange=‘NSE’, token=11287, symbol=‘UPL’, name=‘UPL LIMITED’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 22, ‘buyers’: [1, 2, 1, 2, 1], ‘bid_prices’: [2183.75, 2183.7, 2183.65, 2183.5, 2183.45], ‘bid_quantities’: [16, 44, 40, 6, 3], ‘sellers’: [1, 2, 2, 5, 1], ‘ask_prices’: [2184.85, 2184.9, 2184.95, 2185.0, 2185.05], ‘ask_quantities’: [13, 10, 25, 32, 4], ‘atp’: 2175.59, ‘open’: 2210.0, ‘high’: 2215.95, ‘low’: 2142.05, ‘close’: 2212.05, ‘total_buy_quantity’: 73994, ‘total_sell_quantity’: 63532, ‘volume’: 481187, ‘instrument’: Instrument(exchange=‘NSE’, token=22, symbol=‘ACC’, name=‘ACC LIMITED’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 25, ‘buyers’: [1, 3, 3, 1, 2], ‘bid_prices’: [1521.05, 1521.0, 1520.95, 1520.9, 1520.85], ‘bid_quantities’: [6, 36, 26, 12, 25], ‘sellers’: [2, 1, 2, 1, 1], ‘ask_prices’: [1522.0, 1522.05, 1522.15, 1522.2, 1522.25], ‘ask_quantities’: [57, 25, 123, 12, 18], ‘atp’: 1527.6, ‘open’: 1545.0, ‘high’: 1551.4, ‘low’: 1494.05, ‘close’: 1543.0, ‘total_buy_quantity’: 139230, ‘total_sell_quantity’: 156076, ‘volume’: 1664636, ‘instrument’: Instrument(exchange=‘NSE’, token=25, symbol=‘ADANIENT’, name=‘ADANI ENTERPRISES LIMITED’, expiry=None, lot_size=None)}
{‘exchange’: ‘NSE’, ‘token’: 10666, ‘buyers’: [17, 37, 80, 44, 89], ‘bid_prices’: [45.0, 44.95, 44.9, 44.85, 44.8], ‘bid_quantities’: [260304, 57562, 115271, 99281, 167301], ‘sellers’: [33, 137, 81, 145, 114], ‘ask_prices’: [45.05, 45.1, 45.15, 45.2, 45.25], ‘ask_quantities’: [45141, 175519, 117337, 199938, 149491], ‘atp’: 44.4, ‘open’: 44.25, ‘high’: 45.5, ‘low’: 43.15, ‘close’: 43.95, ‘total_buy_quantity’: 6782478, ‘total_sell_quantity’: 16092544, ‘volume’: 96077042, ‘instrument’: Instrument(exchange=‘NSE’, token=10666, symbol=‘PNB’, name=‘PUNJAB NATIONAL BANK’, expiry=None, lot_size=None)}