all other functions are getting triggered but the order updates are not flowing in. no errors. please can someone advise what could be the possible issue.
import mysql.connector import time import logging import KiteConnect from KiteConnect import KiteTicker from home import *
# Callback for tick reception. def on_ticks(ws, ticks): if len(ticks) > 0: logging.info("Current mode: {}".format(ticks[0]["mode"]))
# Callback for successful connection. def on_connect(ws, response): logging.info("Successfully connected. Response: {}".format(response)) # RELIANCE BSE tokens = [738561] ws.subscribe(tokens) ws.set_mode(ws.MODE_LTP, tokens) logging.info("Subscribe to tokens in Full mode: {}".format(tokens)) logging.debug('test tsest.,mv?LDfeqalfgl')
# Callback when current connection is closed. def on_close(ws, code, reason): logging.info("Connection closed: {code} - {reason}".format(code=code, reason=reason))
# Callback when connection closed with error. def on_error(ws, code, reason): logging.info("Connection error: {code} - {reason}".format(code=code, reason=reason))
# Callback when reconnect is on progress def on_reconnect(ws, attempts_count): logging.info("Reconnecting: {}".format(attempts_count))
# Callback when all reconnect failed (exhausted max retries) def on_noreconnect(ws): logging.info("Reconnect failed.")
# Infinite loop on the main thread. Nothing after this will run. # You have to use the pre-defined callbacks to manage subscriptions. kws.connect(threaded=True)
while True: if kws.is_connected(): logging.info('Session is active') time.sleep(5)
I just skimmed through your code, it looks fine. It should be fine if you are calling the listener() method properly. Are you able to see, such placed orders on the kite web order book? Are those orders successfully placed?
Order updates are not sent for AMO, you can try a regular order.
Yes, you will receive order updates for orders place on Kite Web as well on Websocket API.