Comments (9)
@gregtuc Hi please help me.
from stocksocket.
@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.
Hi Vishvesh!
Answering your Questions
- 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
-
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.
-
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.
-
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.
@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.
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.
@gregtuc greg no problem ! I am learning the method to integrate node with python. Thank you for the wishes !
from stocksocket.
@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 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.
ok. got it
from stocksocket.
Related Issues (20)
- Method for stopping retrieval of data
- Refactor Puppeteer to open pages for each ticker, rather than new browsers
- Convert to Typescript
- Cant read the yahoo page HOT 5
- Testing HOT 2
- Volume HOT 5
- Overhaul price reading process
- Re-Convert to TS following 2.0 release
- ws not available in client
- Add support for Webull, NYSE, Nasdaq, and CNBC data sockets on top of Yahoo
- Licensing Issue HOT 1
- Sweet client HOT 2
- Not working HOT 3
- Is there a typing for this package?
- How to pull curent market data? HOT 3
- Socket automatically disconnects HOT 1
- Is there a way to receive the last price of a stock when the stock market is closed? HOT 2
- Automatically switch selectors based on active-trading period HOT 1
- Methods for removing one or many tickers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stocksocket.