Giter Club home page Giter Club logo

Comments (9)

vishvesh098 avatar vishvesh098 commented on June 3, 2024

@gregtuc Hi please help me.

from stocksocket.

vishvesh098 avatar vishvesh098 commented on June 3, 2024

@gregtuc hi i recently started it by installing repo into C:\Program Files\nodejs\node_modules and the script works !! is this the correct way to use it ?

Also can you guide me on how to connect output of this livestream to my python code ? I need json output for my code.

Thank you !

from stocksocket.

gregtuc avatar gregtuc commented on June 3, 2024

Hi Vishvesh!

Answering your Questions

  1. This is an npm (node package manager) module. I made two sample directories available on my profile. The advanced repository has a larger implementation using React (client-side), and the basic application runs a small express server and just logs the results (Note that you don't need an actual server to run this code, it's just how I typically set up my test scripts). To use sample-stocksocket-basic:
  • Clone the repository
  • Navigate to the repository in your command line using cd sample-stocksocket-basic
  • Run npm install in your command line
  • Run node index.js
  1. I have run load tests with the module for several hours with 120 tickers with minimal losses in speed. I'm unsure about scaling to 160 tickers, but it's probably fine.

  2. The Websocket is designed not to have a timeout set, as in some situations it must continue running with no input for several days (like when the markets are closed over the weekend). That being said, there are plans to implement some redundancy measures in my code in case of a drop/disconnect moving forward. There have been no issues reported with dropped/disconnected connections yet, though.

  3. Sounds like a very cool project man!

Integrating the module into Python

Now for connecting the output to your Python code, I'm not positive on the best way to do that. I recommend taking a look at this article here: https://www.sohamkamani.com/blog/2015/08/21/python-nodejs-comm/
I'll see if I can rig up an example for you over the weekend :-)

If that doesn't work, the other (probably much slower and less efficient) method that I can think of is having a Node.js server set up that sends the stock data to a Python-based server every time that stock data comes in (via websocket or HTTP stream).

from stocksocket.

vishvesh098 avatar vishvesh098 commented on June 3, 2024

@gregtuc Thank you Greg for such awesome response ! I will try running those scripts ! Thank you for your efforts !

On Integrating the module into Python:-

I can not wait to see your example ! Meanwhile I try with sohamkamani.com method.

Thanks & Regards,
Vishvesh

from stocksocket.

gregtuc avatar gregtuc commented on June 3, 2024

I can not wait to see your example ! Meanwhile I try with sohamkamani.com method.

Thanks & Regards,
Vishvesh

I won’t be able to find time this week to make an example, sorry! Best of luck with it though.

from stocksocket.

vishvesh098 avatar vishvesh098 commented on June 3, 2024

@gregtuc greg no problem ! I am learning the method to integrate node with python. Thank you for the wishes !

from stocksocket.

vishvesh098 avatar vishvesh098 commented on June 3, 2024

@gregtuc Hi greg ! can you do me a favor ? If possible can you give me file which gives just id, price, time and volume ? (because in my database I store price, time & volume data in Ticker Specific Tables so it may reduce time on my end)

By doing so will it reduce the workload both on my side as well as on yahoo webstreaming (Considering 160 tickers) ?

I am currently tinkering _finstreamer-proto.js but it is very complex to understand !

from stocksocket.

gregtuc avatar gregtuc commented on June 3, 2024

@gregtuc Hi greg ! can you do me a favor ? If possible can you give me file which gives just id, price, time and volume ? (because in my database I store price, time & volume data in Ticker Specific Tables so it may reduce time on my end)

By doing so will it reduce the workload both on my side as well as on yahoo webstreaming (Considering 160 tickers) ?

I am currently tinkering _finstreamer-proto.js but it is very complex to understand !

The data structure is sent from Yahoo servers, I don’t control any of the contents. You could change the protobuf file to only decode specific properties, but I’m not sure it would reduce workload in any significant way.

Hope that helps

from stocksocket.

vishvesh098 avatar vishvesh098 commented on June 3, 2024

ok. got it

from stocksocket.

Related Issues (20)

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.