ReactorNotRestartable error on kws.connect

argy
I followed the example and made the code. But it is giving an error on kws.connect.

Sample code without tokens attached.
  • rakeshr
    def on_ticks(ws, ticks):
    # Callback to receive ticks.
    print("Inside on_ticks")
    logging.debug("Ticks: {}".format(ticks))
    for tick in ticks:
    for stock in stocks:
    if stock.instrument==tick["instrument_token"]:
    stock.update(tick)
    ##if stock.recommend!=0:
    ## if recommend =1 buy, 2 close sell and open buy position, -2 close buy and open sell positio
    You are blocking main ticker thread, by performing computation inside on_ticks. You can go through this thread to know more.
Sign In or Register to comment.