Closed JonRay15 closed 7 months ago
@JonRay15 @barnabee I don't actually see any overlapping here, I think the reduced gaps between candles and the zoom level is making it appear that the candles are touching.
@mattrussell36 I think you are misreading the ticket - it is about the open and close levels (bottom and top of fat part respeectively, for an upward move) not horizontal width and placement.
To explain the bug more clearly.
IIRC the original definition of a candle given open
, high
, low
, close
data is as follows:
Wick (thin part):
high
(highest price printed on any trade during the period)low
(lowest price printed on any trade during the period)Body (fat part):
close
(last trade IN period) > open
(first trade IN period)close
< open
Candle colour:
close
(this period) > close
(last period)close
(this period) < close
(last period)So the issue is suggesting that a green candle's body can never overlap another green candle's body because the colour compares the two closing prices, so if they overlap they'd always be different colours.
It doesn't look like pennant applies the hollow/filled logic at all, and it seems like a good number of centralised crypto exchanges also don't do this (or they have so many trades that open vs close and previous close vs close are almost always the same). However they do all seem to use the comparison between period close prices for colouring the candles, not the the open
<> close
, as far as I can see.
On TradingView you can switch the type to "hollow candles" rather than candles and you'll see that where the open
<> close
direction and the previous close
<> close
direction differ (and assuming a correct data source that does't always send the previous close
as open
) you get a hollow red or filled green candle:
It would be nice for us to support this (as an additional chart type in the dropdown), as well as fix the colouring of the default view. I'd imagine such support would be quite simple given there's no change to the rendering logic only colours and filled or not.
I dont think we know the correct thing here .... this feels like it needs some more investigation and research, and also could be solkved by having a setting to toggle behaviour.
@JonRay15 I agree we aren't 100% sure what we want for the normal default filled candles behaviour.
Also think the full "hollow candles" new chart type per the definition at the start of this comment can be split out into a second ticket and that is well defined and could be built if we wish (IMO it'd be cool but not essential, perhaps if we had resource to work on Pennant and not much else to do there).
Description
We have overlapping candles on the chart, which is bad.
Steps to Reproduce
Expected behavior
The open / close on two adjacent green candles should nmever overlap, it doesnt make sense. Since candle is only green if close > open it shoud be impossible.
Screenshots
Tasks
Device details
Desktop (please complete the following information):
Smartphone (please complete the following information):
n/a
Additional context
Add any other context about the problem here.