Christopher Thoman
Christopher Thoman

Reputation: 1

How Does Trading View Determine the Bar Color for Heikin Ashi Bars

Can someone explain how Trading View determines the final bar color for the Heikin Ashi chart?

I would have expected the final bar color to be determined by comparing the final closing value to the previous bar's closing value. This does not always appear to be the case. For example, in the screenshots below, you can see that the 30 Nov '21 17:26 bar has a close price of 166.38 and the previous bar (30 Nov '21 17:25) has a close price of 166.45. The 17:26 bar is colored green despite having a lower closing price than the previous bar.

Furthermore, calculating the Heikin Ashi close (OHLC)/4 and plotting the results mapped with colors based on close does yield the expected results. Plotting the built-in OHLC4 variable with the correct colors also yields the expected results.

Is the default Heikin Ashi color bugged in this case, or are there other variables being used to determine the bar color?

Final question, how would Trading View handle the color if the comparison between the current bar and last bar are equal?

AAPL 1726 Nov 30

AAPL 1725 Nov 30

Upvotes: 0

Views: 537

Answers (1)

Christopher Thoman
Christopher Thoman

Reputation: 1

I realize now the mistake and confusion. The color is based on comparing the close price to the open price, not to the previous bar close price.

Upvotes: 0

Related Questions