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

OHLC with C > H and QC of data #123

Closed jdumont0201 closed 4 years ago

jdumont0201 commented 4 years ago

Hi, OHLC stock data is plagued with inconsistent off the charts values with C >H. At specific timestamps, it shows the current trading value as 'c' instead of the close of the bar.

As I write, trading value of MSFT is 165 and it wrongly appears in the historical data of many years ago.

Example: https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1585010909&to=1585039609&token=YOURTOKEN

{ c: [ 165.6 ], h: [ 143 ], l: [ 141 ], o: [ 141.28 ], s: "ok", t: [ 1585036800 ], v: [ 41406 ] }

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1547809000&to=1547809609&token=bpv606vrh5rabkt31ka0

{ c: [ 164.67 ], h: [ 106.5 ], l: [ 106.5 ], o: [ 106.5 ], s: "ok", t: [ 1547809200 ], v: [ 500 ] }

This is a plot of C over two years. The exact same value 165ish pops all the time. https://imgur.com/a/ofU5sB5

Don't you have basic quality control on your data? Thanks.

jdumont0201 commented 4 years ago

OHLC with O < L also happens.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1548279000&to=1548281009&token=YOURTOKEN

Was

{ c: [ 106.71 ], h: [ 106.7651 ], l: [ 106.56 ], o: [ 106.48 ], s: "ok", t: [ 1548277200 ], v: [ 12271 ] } now { c: [ 106.71 ], h: [ 106.7651 ], l: [ 106.65 ], o: [ 106.7 ], s: "ok", t: [ 1548277200 ], v: [ 12271 ] }

Two problems:

occasionallydavid commented 4 years ago

FWIW I cancelled my subscription until the rate at which these data issues turn up verifiably dissipates. It seemed almost pointless to file tickets about many instances of missing data I found because I have no doubt you are already aware of them.

It might be worth slapping a [BETA] tag on all the endpoints in the docs then focusing solely on removing that label from candles and ticks, nothing else really matters if these pieces are so spotty.

bowyern commented 4 years ago

I see O or C outside the L/H bounds on about 45% of the 5m candle data I've looked at.

finnhubio commented 4 years ago

Hi guys, we are aware of the issue. Our apology. It will be fixed by the end of the week.

finnhubio commented 4 years ago

This is a plot of C over two years. The exact same value 165ish pops all the time. https://imgur.com/a/ofU5sB5

Don't you have basic quality control on your data? Thanks.

this issue specifically has been fixed.

jdumont0201 commented 4 years ago

The same data on two different timespans (from/to) can also show different values. Example with hourly MSFT at ts 1163682000.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163688188&token=YOURTOKEN

{ c: [ 29.12, 29.19 ], h: [ 29.11, 29.23 ], l: [ 29.03, 29.1 ], o: [ 29.03, 29.12 ], s: "ok", t: [ 1163682000, 1163685600 ], v: [ 29687, 2475343 ] }

is different when narrowed down.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163684188&token=YOURTOKEN

{ c: [ 29.03 ], h: [ 29.1 ], l: [ 29.03 ], o: [ 29.03 ], s: "ok", t: [ 1163682000 ], v: [ 7001 ] }

soffio commented 4 years ago

The same data on two different timespans (from/to) can also show different values. Example with hourly MSFT at ts 1163682000.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163688188&token=YOURTOKEN

{ c: [ 29.12, 29.19 ], h: [ 29.11, 29.23 ], l: [ 29.03, 29.1 ], o: [ 29.03, 29.12 ], s: "ok", t: [ 1163682000, 1163685600 ], v: [ 29687, 2475343 ] }

is different when narrowed down.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163684188&token=YOURTOKEN

{ c: [ 29.03 ], h: [ 29.1 ], l: [ 29.03 ], o: [ 29.03 ], s: "ok", t: [ 1163682000 ], v: [ 7001 ] }

I also have this problem.

GF-Huang commented 4 years ago

@finnhubio What is your data source? Why is there such an error? I am very concerned about this issue.

finnhubio commented 4 years ago

@finnhubio What is your data source? Why is there such an error? I am very concerned about this issue.

There was an error when we built this data from tick. It will be fixed by the end of Sunday. We are already importing the new data in.

finnhubio commented 4 years ago

The same data on two different timespans (from/to) can also show different values. Example with hourly MSFT at ts 1163682000.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163688188&token=YOURTOKEN

{ c: [ 29.12, 29.19 ], h: [ 29.11, 29.23 ], l: [ 29.03, 29.1 ], o: [ 29.03, 29.12 ], s: "ok", t: [ 1163682000, 1163685600 ], v: [ 29687, 2475343 ] }

is different when narrowed down.

https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163684188&token=YOURTOKEN

{ c: [ 29.03 ], h: [ 29.1 ], l: [ 29.03 ], o: [ 29.03 ], s: "ok", t: [ 1163682000 ], v: [ 7001 ] }

Regarding this issue, you need to expand the "to" params. For example in the 2nd request, you are requesting data from 8:00 -> 8:36 AM, so the API will build the 1H candle using 36 minutes of data. You need to expand the "to" param to 8:59AM and you will get the same result.

Try this instead of your 2nd link: https://finnhub.io/api/v1/stock/candle?symbol=MSFT&resolution=60&from=1163675388&to=1163685540&token=

finnhubio commented 4 years ago

As promised, the primary issue with "OHLC with C > H and QC of data" has been fixed. Can you guys try it out and let us know ?

finnhubio commented 4 years ago

As no bug is reported after the fix, we will close this issue for now.