finnhubio / Finnhub-API

Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals and alternative data. https://finnhub.io/docs/api
98 stars 6 forks source link

websocket stucks #36

Closed pycoder2020 closed 4 years ago

pycoder2020 commented 4 years ago

Simply stops and do not do anything (token removed)

--- request header ---

Upgrade: websocket
Host: ws.finnhub.io
Origin: http://ws.finnhub.io
Sec-WebSocket-Key: dbiUIWjFpEA1m25jPOcD7Q==
Sec-WebSocket-Version: 13
Connection: upgrade

-----------------------
--- response header ---
finnhubio commented 4 years ago

plz try again. should be fixed now

pycoder2020 commented 4 years ago

after few minutes I get response

--- response header ---
HTTP/1.1 101 Switching Protocols
Server: nginx/1.10.3
Date: Wed, 18 Mar 2020 19:59:00 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: yZ2HZoHZGz/CRDZOy3t0AYVaYro=
-----------------------
send: b'\x81\xa4k@y_\x10b\r&\x1b%[eI3\x0c=\x18#\x0b6\t%[sI3\x002\t/\x15}Qb-\x0b<\x0f["'

But stream is also with interrupts comparing with Tradestation Tick data

pycoder2020 commented 4 years ago

Market closed... Problem with server overload?

finnhubio commented 4 years ago

We can not comment on other providers' feed. We provide after market hour price as well so it doesn't matter if market closes, trades might still happen

pycoder2020 commented 4 years ago

I mean interrupts :) Will continue compare real-time data tomorrow. Thanks for responses.

pycoder2020 commented 4 years ago

Now WS works without stuck

pycoder2020 commented 4 years ago

current delay for me is 2s

22:09:42 INFO     {"type":"ping"}
22:10:42 INFO     {"type":"ping"}
22:11:02 INFO     {"data":[{"p":110.5941,"s":"TTWO","t":1584562262644,"v":300}],"type":"trade"}
22:11:42 INFO     {"data":[{"p":105.064874,"s":"TTWO","t":1584562302444,"v":10334}],"type":"trade"}
pycoder2020 commented 4 years ago

current delay up to 700ms

finnhubio commented 4 years ago

If every ms matters for your trading strategy, we will not be the right provider at this point. Depending on the number of concurrent connection to our server, the latency can go up or down at time.