Code Monkey home page Code Monkey logo

yflive's People

Contributors

deepsourcebot avatar mbnlc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yflive's Issues

premature closing of websocket

Greetings,

I have observed that the web socket is automatically closed after a certain interval of time.

When we subscribe to certain scripts that have very low trading going on, ticks for these symbols may come minutes apart sometimes. I suspected that the Yahoo servers may be seeing no activity for these periods and actively closing the web socket, so I added an market index to the subscription list which has very good tick flow.

This too resulted in the web socket closing automatically. I was hoping there would be a way to keep the web socket alive for the duration of the market ( 6 hours 30 minutes to be precise ), so that I will not have to restart my code every time it fails.

Seeking your suggestions and advise on this.

Regards

Asyncio support?

Thanks a lot for this very useful module! It works great! I was wondering if there is asyncio support. I also tried the threading option setting to true but this terminated the run without an error (using the sample code you provide in README). Have you tested with multiple stocks and know limitations, how computationally demanding is given an increasing number of subscriptions?

Threading self._websocket.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})

Greetings

from yflive import QuoteStreamer
qs = QuoteStreamer()
qs.subscribe(["AAPL", "TSLA"]) 
qs.on_quote = lambda q: print(q)
qs.start()
# unreachable code
print("unreachable code.")

After running your code I noticed anything put after qs.start() is unreachable till the ws is active. I would like to request you kindly see if it will be possible to thread the self._websocket.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE}) so that it can run in the background as a daemon. If possible please also include a mechanism to stop the ws after its no more required.

Kindly check Upstox-API to see an example. Thank You.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.