i am not able to get the individual parameters from the dictionary... it is throwing none type error.i have not defined custom_message function. brokerTicks = self.ticker.subscribe(symbol=Symbols,data_type='symbolData') ticks = [] for symbol_data in bro

i am not able to get the individual parameters from the dictionary… it is throwing none type error.i have not defined custom_message function.

brokerTicks = self.ticker.subscribe(symbol=Symbols,data_type=‘symbolData’)

ticks =
for symbol_data in brokerTicks:
isd = Instruments.getInstrumentDataBySymbol(symbol_data[‘symbol’])
tradingSymbol = isd[‘symbol’]
tick = TickData(tradingSymbol)
tick.lastTradedPrice = symbol_data[‘ltp’]
tick.lastTradedQuantity = symbol_data[‘last_traded_quantity’]
tick.avgTradedPrice = symbol_data[‘avg_trade_price’]
tick.volume = symbol_data[‘vol_traded_today’]
tick.totalBuyQuantity = symbol_data[‘tot_buy_qty’]
tick.totalSellQuantity = symbol_data[‘tot_sell_qty’]
tick.open = symbol_data[‘open_price’]
tick.high = symbol_data[‘high_price’]
tick.low = symbol_data[‘low_price’]
tick.close = symbol_data[‘close_price’]
ticks.append(tick)

Try this,
I had a code to write symbol name and ltp to an excel sheet from websocket, see if it helps you.

import csv
from fyers_api.Websocket import ws

def run_process_foreground_symbol_data(access_token):
    '''This function is used for running the symbolData in foreground 
    1. log_path here is configurable this specifies where the output will be stored for you
    2. data_type == symbolData this specfies while using this function you will be able to connect to symbolwebsocket to get the symbolData
    3. run_background = False specifies that the process will be running in foreground'''
    data_type = "symbolData"
    symbol = ["NSE:SBIN-EQ"]   ##NSE,BSE sample symbols
    fs = ws.FyersSocket(access_token=access_token,run_background=False,log_path="")
    fs.websocket_data = custom_message
    fs.subscribe(symbol=symbol,data_type=data_type)
    fs.keep_running()

def custom_message(msg):
    out = csv.writer(open('test.csv', 'a'))
    out.writerow([msg[0]['symbol'], msg[0]['ltp']])

def main():
    header = ["SYMBOL", "LTP"]
    with open('test.csv', 'w', encoding='UTF8') as f:
        writer = csv.writer(f)
        writer.writerow(header)

    ### Insert the accessToken and app_id over here in the following format (APP_ID:access_token) 
    access_token = ""  #appid:accesstoken

    ## run a specific process you need to connect to get the updates on
    run_process_foreground_symbol_data(access_token)
    
if __name__ == '__main__':
	main()

Hey thanks! This solves my issue…