Quote Stream - Push real-time stock quotes in JSON over web-sockets with node.js
nodesocket.github.com
nodesocket.github.com
Screen scraping Google / Yahoo finance and using that data in an app is (I believe) explicitly against their TOS. Whether or not they ever enforce that is another story...
The actual real-time data streams are highly controlled and regulated by a few big players.
(Just my $0.02 after having looked into it about a year ago for a social investing app I was building)
As parent said, you're better off getting a real market stream which will probably use FIX: http://en.wikipedia.org/wiki/Financial_Information_eXchange
{
"ticker": "AAPL",
"exchange": "NASDAQ",
"price": "598.86",
"change": "-9.48",
"change_percent": "-1.56",
"last_trade_time": "Apr 19, 9:30AM EDT"
}EDIT: I guess a few of them are actually realtime now. Here's the list: http://www.google.com/intl/en/googlefinance/disclaimer/
I guess I'm struggling to see how:
"Stock quotes are pulled from Google Finance and are real-time."
and
"By default stock quotes are fetched every 5 seconds, and pushed to the client."
Work together...
Great work on sharing the code though, thanks.
"Real time. You keep using that phrase. I do not think it means what you think it means."
{ "ticker": "MSFT", "exchange": "NASDAQ", "price": "31.26", "change": "+0.12", "change_percent": "0.38", "last_trade_time": "Apr 19, 10:17AM EDT" } { "ticker": "AAPL", "exchange": "NASDAQ", "price": "598.27", "change": "-10.07", "change_percent": "-1.66", "last_trade_time": "Apr 19, 10:17AM EDT" }
Also, the URL "http://xhv51cz0.nodesocket.com/quote-stream/MSFT/ works but "http://xhv51cz0.nodesocket.com/quote-stream/MSFT does not (without "/" in the end)
It uses iPhone accelerometer to control the ship on your browser game!
I had exactly this idea a few weeks ago, and never put any time into it.
Just goes to show you...
This is pretty cool, good work
A real-time quote provider is someone who's server is physically connected to a direct exchange feed, as in you have a 5' wire running from your box to one of the CME's servers, not someone who's obtaining web-based delayed quotes.
Within the US there are a number of ECNs/exchanges. Each one publishes there own order book including prices and sizes on each side of the book. To get the most accurate information possible on market prices, you need to have a direct connection to each exchange and usually, you want to be co-located within the same data center as them. Unless you're a market maker, high-frequency trader, or run an institutional electronic trading platform, this level of data is not necessary.
For most human traders, a consolidated feed is sufficient; that data comes from an authority called the CTA. From wikipedia: "Since the late 1970s, all SEC-registered exchanges and market centers that trade NYSE or AMEX-listed securities send their trades and quotes to a central consolidator where the Consolidated Tape System (CTS) and Consolidated Quotation System (CQS) data streams are produced and distributed worldwide." The consolidation process delays the data by ~100 ms. This is still considered real-time by many people including professional traders.
Most HN readers are getting a conflated version of the consolidated feed. Google's "real-time" feed falls into this category and adding 5 seconds doesn't really matter at this point.
You're living in the past.
> The consolidation process delays the data by ~100 ms. This is still considered real-time by many people including professional traders.
A couple of months ago we achieved round-trip [cleared] trades between Tokyo and New York of under 50ms. That's your barrier to entry.
You're not in business if you're looking at an average of 100ms.
> You're not in business if you're looking at an average of 100ms.
You're not in business if your business is latency arb. Buffett doesn't care about your 50 ms.
If we evaluate (10879 / 299792.458) * 1000 = 36.28. This is for a single leg. So we get 72.57 milliseconds just for as the crow flies transport. This does not include other factors that contribute to latency (network, processing, etc.)
For "round trip" as you say then this number should be multiplied by 2 as it has to go NYC -> Tokyo, Tokyo -> NYC.
Have you developed some sort of faster than the speed of light communication mechanism we haven't heard of? Inquiring minds demand to know.
Edit: One possible explanation is that you are using multiple time sources that are not synchronized. E.g. if you send a FIX message to an ECN and use the clock available on your machine and then use the ECN's timestamps somewhere in your calculation this renders the measurement invalid because you can't ensure that your clocks are synchronized.