Sidechair

chart.is_heikinashi

Browse the reference

True when the chart shows Heikin Ashi candles, whose values are averaged from the real bars.

Try it in the editor

A Heikin Ashi close is the average of the real bar's open, high, low and close, and its open is the midpoint of the previous Heikin Ashi candle. So the close a script reads is already smoothed, and the true open is gone.

On a standard chart ohlc4 equals that close, which lets a script produce the same number on either chart type and compare.

Type

simple bool

Example

Pine ScriptHeikin Ashi close on any chart typeOpen in editor
//@version=6
indicator("chart.is_heikinashi: same close everywhere", overlay = true)
haClose = chart.is_heikinashi ? close : ohlc4
plot(haClose, "HA close", color.orange)

See also

Runs on Sidechair