I have my access_token and api_key and using it to send mkt orders but while I try to fetch the tick data using KiteTicker API I get 1006 connection error (Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake). Could you please help understand why is this happening?
Sample code below:
from kiteconnect import KiteConnect from kiteconnect import KiteTicker
def on_ticks(ws, ticks): # Callback to receive ticks. print(ticks) print("\n")
def on_connect(ws, response): # Callback on successful connect. # Subscribe to a list of instrument_tokens (RELIANCE and ACC here). ws.subscribe([81153])
# Set RELIANCE to tick in `full` mode. ws.set_mode(ws.MODE_FULL, [81153])
def on_close(ws, code, reason): # On connection close stop the event loop. # Reconnection will not happen after executing `ws.stop()` ws.stop()
@rakeshr I went through the same FAQs but couldn't find my exact problem solution there. Could you point me to the exact post you're referring please? I have tried uninstalling and installing back OpenSSL, also tried a few other steps detailed there for no luck though. Hence need your some suggestions.
@rakeshr Also to be specific the FAQ does list problem and solutions for "Connection error: 1006 - connection was closed uncleanly (None)"but nothing for "Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)"
@akhil811 because you pasted code and python is an indentation based language, it is not clear whether you have made indentation mistake or not. Please ensure there is no indentation mistake
if you think there is none, then please share exact indented code in your python file via attachment or screenshot
if you think there is none, then please share exact indented code in your python file via attachment or screenshot