Does this make any sense to you, asyncio Package is a Dependency for the Fyres websocket, so probably I am messing with some dependency. Not able to find it though
Are you running socket connection in an async mode. If so change it to run on main thread and use threading instead of async.
As in fyers_api → ws.py file they have created a new event_loop to parse message(binary to str, using asyncio). You cant create multiple loops within, so try threading instead.
I have spent 2 days on this issue and couldn’t resolve, lets wait for a rollout update clearing all boiler plate code.
*** Try printing self.response and not self in socket connection, self acts as a pointer*****.**
Hi Arun I am guessing you are using jupyter notebooks, please try it in nomal .py file… if you really want to use it in .ipynb files, you have to add another dependency, nest_asyncio.
data_type = ‘symbolData’ #(for symbol websocket the data_type has to be “symbolData”)
symbol =[‘NSE:SBIN-EQ’]
access_token=client_id + ‘:’ + ac_t
(This is the custom message function which we need to have in order to receive the Symbol/order update and accordingly you can manipulate the data you receive through this function )
@jpNs7tOaH3 Thanks man. I am not using jupyter notebook but using spyder in a conda env
I was able to connect to socket and get data, by running it as a plain py file from the terminal, but still having the same issue if I try to run it from spyder in my conda env
Sorry for the delayed response, following is my imports
from fyers_api import fyersModel
from fyers_api import accessToken
import time
import get_auth_code
import datetime
import pandas as pd
import threading
import os
import math
import pyautogui
import requests
from enum import Enum
from dotenv import dotenv_values