A smoothed candlestick chart that averages price to make trends and pauses easier to see.
Heikin Ashi (Japanese for "average bar") is an alternative way of drawing candles. Instead of plotting raw open, high, low, and close, each candle is built from averaged values that blend the current bar with the prior Heikin Ashi candle. The result is a chart that filters out some of the bar-to-bar noise of standard candlesticks, so stretches of one-directional movement and periods of indecision tend to stand out more clearly. It is a charting and visualization technique, not a buy/sell signal generator, and it does not predict future prices. Trading carries risk of loss.
Heikin Ashi candles are calculated from the regular OHLC of each bar using a recursive formula. The HA close is the average of the current bar's open, high, low, and close: (open + high + low + close) / 4. The HA open is the average of the previous HA open and previous HA close: (HA_open[1] + HA_close[1]) / 2 — for the very first bar it is typically seeded from the regular open and close, since there is no prior HA candle to reference. The HA high is the maximum of the current high, the HA open, and the HA close; the HA low is the minimum of the current low, the HA open, and the HA close. Because each candle's open depends on the prior HA candle, values are smoothed across bars rather than each candle standing alone. Note this also means the open and close you see are averaged figures, not the actual traded open and close for that period.
Heikin Ashi has no traditional input parameters — it is a fixed transformation of OHLC. In most platforms you simply switch the chart type to Heikin Ashi, or plot it from a script. The main choices are cosmetic (up/down colors, wick colors) and which timeframe the candles are built on.
//@version=6
indicator("Heikin Ashi (overlay)", overlay = true)
// Request Heikin Ashi OHLC for the chart's own symbol/timeframe.
// Note: request.security on intrabar/lower timeframes can repaint;
// use barmerge args or confirmed bars if that matters for your study.
haTicker = ticker.heikinashi(syminfo.tickerid)
haOpen = request.security(haTicker, timeframe.period, open)
haHigh = request.security(haTicker, timeframe.period, high)
haLow = request.security(haTicker, timeframe.period, low)
haClose = request.security(haTicker, timeframe.period, close)
upBar = haClose >= haOpen
plotcandle(haOpen, haHigh, haLow, haClose, title = "HA",
color = upBar ? color.teal : color.red,
wickcolor = color.gray, bordercolor = na)
// Educational only. Not a signal or recommendation. Trading carries risk of loss.Pro tip: Keep a standard candlestick chart alongside Heikin Ashi: use HA to gauge the overall character of a move, but read actual prices, gaps, and levels from the real candles so you are never relying on averaged figures for exact decisions.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.