Error in kiteticker

gsuryagandh
I am just trying to get the example given on the github repo. But I am getting following error
ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Con
  • rakeshr
    Hi @gsuryagandh
    Make sure you are on latest latest Kite connect python client.Update using: pip install kiteconnect --upgrade.
  • gsuryagandh
    gsuryagandh edited February 2018
    @rakeshr
    I did that but i am still facing the same problem
    ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
    ].
    ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): : Connection was aborted locally, using.
    ].
    ERROR:kiteconnect.ticker:Try reconnecting. Retry attempt count: 1



    Below is my sample code
     kws = KiteTicker(my_API_KEY,  my_REQUEST_TOKEN)
    print kws
    kws.on_tick = on_ticks
    kws.on_connect = on_connect
    kws.connect()

    def on_ticks(ws, ticks):
    # Callback to receive ticks.
    logging.debug("Ticks: {}".format(ticks))

    def on_connect(ws, response):
    ws.subscribe([738561, 5633])
    ws.set_mode(ws.MODE_FULL, [738561])


  • rakeshr
    Hi @gsuryagandh,
    Below are the errors in your code:
    1> You need to pass 'access_token', as parameter in kiteTicker, but you are sending Request_token.
    2>Callbacks need to be assigned , after the function definition.
    kws.on_ticks = on_ticks 
    kws.on_connect = on_connect
    kws.connect()
    3>You are missing 's' from kws.on_tick callback.

    Refer to this code on documentation.
Sign In or Register to comment.