tradingview / lightweight-charts

Performant financial charts built with HTML5 canvas
https://www.tradingview.com/lightweight-charts/
Apache License 2.0
9.14k stars 1.58k forks source link

Wrong colors on some candlesticks #1308

Closed alexiuz24 closed 1 year ago

alexiuz24 commented 1 year ago

Lightweight Charts Version: 4.0

My charts always gets some candlestick bars that are the wrong color. About 1 in 100 or so bullish candles go red and bearish candles go green.

Screenshot

lightweight-err-1

I made a JsFiddle: https://jsfiddle.net/dqm3t78e/ The inputs below the chart are in order datetime, open, high, low, close (as you can see from the class names) The error is visible on the 2023-1-14 23:00:00 candlestick, which is red, but it is bullish according to price data. (JsFiddle and screenshot above are two different charts - but same error)

You can see the error on my website as well. rb.gy/rdnfs5

alexiuz24 commented 1 year ago

I figured out that my price data were string and not numbers. Seems to work fine now!