hi ....can u plssssss help me .....I am not getting the ltp from websocket from zerodha ........ I have tried to read everywhere not finding any solution. Here is my codE:
from kiteconnect import KiteTicker
import logging
import time
# Configure logging to print to console.
logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s [%(levelname)s] %(message)s")
# Replace with your actual API key and Access Token.
api_key = "zfqm1rs1fitrsk57"
access_token = "MU04kvEkPyVhj6J5vM2bgMwFxzkWFdAX"
# Set the instrument token for the index (e.g., NIFTY BANK token).
index_token = 260105
def on_tick(ws, ticks):
# Loop through all ticks and print if it matches the index token.
for tick in ticks:
logging.debug("Tick received: %s", tick)
if tick["instrument_token"] == index_token:
logging.info("Index tick received: %s", tick)
else:
logging.debug("Other tick: %s", tick)
def on_connect(ws, response):
logging.info("
April 1