Zen8_ith

About

Username
Zen8_ith
Joined
Visits
229
Last Active
Roles
Member

Activity

  • rbm
    Hey Hi Zen8_ith

    Can you share python code for Websocket tick data streaming

    I am getting 10006 error by running below simple code

    from kiteconnect import KiteTicker
    import datetime, time, pickle
    import zrd_login
    kite=zrd_login.kite
    import pdb
    import logging
    #from kiteconnect import WebSocket

    segment="MCX:"
    name = "CRUDEOIL23NOVFUT"
    token = kite.ltp(segment+name)[segment + name]['instrument_token']
    print(token)

    pdb.set_trace()
    kws = KiteTicker("","")

    def on_tick(wbskt,ticks):
    print(ticks)

    def on_connect(wbskt,response):
    wbskt.subscribe(token)
    wbskt.set_mode(wbskt.MODE_FULL,token)

    def on_close(wbskt,code,reason):
    print(code,reason)
    wbskt.stop()


    kws.on_tick=on_tick
    kws.on_connect=on_connect
    kws.on_close=on_close

    pdb.set_trace()

    kws.connect()
    October 2023