Heikin Ashi vs candlestick: the calculation changes
Let O, H, L and C denote the current standard bar. HA-O, HA-H, HA-L and HA-C denote its Heikin Ashi values. The previous open and close in the HA formula are previous HA values, not previous ordinary candle values. All examples below compare completed bars on one time interval.
- HA open is recursive. Reproducing it requires a previous HA state or an explicit initialization rule. Do not restart the calculation at each visible candle.
- This comparison uses body direction: green when close exceeds open, red when it is below open. Disable "Color bars based on previous close" when comparing colors in TradingView; that option changes their meaning.
| Value | Standard candle | Heikin Ashi candle |
|---|
| Open | O | (Previous HA-O + previous HA-C) / 2 |
| Close | C | (O + H + L + C) / 4 |
| High | H | Maximum of H, HA-O and HA-C |
| Low | L | Minimum of L, HA-O and HA-C |
| Body size | Absolute difference between C and O | Absolute difference between HA-C and HA-O |
Four bars of identical OHLC input
These are hypothetical prices, not historical performance. Start with a supplied previous HA open of 98 and HA close of 100, making bar A's HA open 99. This is an explicit starting state for the worked example, not a claim about TradingView's first available bar. Bars A through D are consecutive, and bar C contains an upward price gap.
| Bar | Open | High | Low | Close | Standard body direction |
|---|
| A | 100 | 104 | 99 | 103 | Green |
| B | 103 | 106 | 102 | 102.5 | Red |
| C | 110 | 112 | 109 | 111 | Green |
| D | 111 | 111.5 | 103 | 104 | Red |
The same bars after the Heikin Ashi transformation
Bar A closes at (100 + 104 + 99 + 103) / 4 = 101.5 in HA terms. Bar B therefore opens at (99 + 101.5) / 2 = 100.25, and its HA close is 103.375. Carry those transformed values forward to compute C and D. The numbers below are exact for the stated inputs and starting state.
- B closes below its ordinary open and below A's market close, yet HA remains green. HA color is a comparison of synthetic body endpoints.
- C's true opening gap is 110 − 102.5 = 7.5. Its HA open is 101.8125, below the entire current market range of 109 to 112. The HA body reaches through prices absent from that bar's market range.
- D's market close falls from 111 to 104 while HA stays green at 107.375 versus an HA open of 106.15625. A color-only exit would not recognize this bar as a red HA candle.
| Bar | HA open | HA high | HA low | HA close | HA body direction |
|---|
| A | 99 | 104 | 99 | 101.5 | Green |
| B | 100.25 | 106 | 100.25 | 103.375 | Green |
| C | 101.8125 | 112 | 101.8125 | 110.5 | Green |
| D | 106.15625 | 111.5 | 103 | 107.375 | Green |
Body and wick measurements are not interchangeable
For bar C, the ordinary body measures 1 and the full high-low range measures 3. The HA body measures 8.6875 and its range measures 10.1875. Neither is an arithmetic error: they measure different endpoints. In particular, an HA low can come from a recursive open rather than a trade during the current interval.
- A missing HA lower wick is a property of the transformed candle. Here it does not mean that the market traded only upward: the ordinary low of 109 is below the opening price of 110.
- A wick-to-body pattern rule designed for ordinary candles changes meaning on HA. Recheck its inputs before calling a transformed candle a hammer, doji or other price pattern.
| Measurement on bar C | Standard candles | Heikin Ashi |
|---|
| Body: absolute close minus open | 1 | 8.6875 |
| Range: high minus low | 3 | 10.1875 |
| Upper wick: high minus body top | 1 | 1.5 |
| Lower wick: body bottom minus low | 1 | 0 |
Compare chart views without mixing the price sources
Open one exchange symbol in TradingView and record its interval, session and adjustment settings. Select Candles in the chart-type menu, inspect a completed bar, then select Heikin Ashi and inspect the same timestamp. Keep the data settings fixed. If using two charts, match them before comparing the readings.
- Record the standard open, close and gap first. Then compare HA body direction and wick shape. The four-bar example is a calculation exercise; a live symbol will have its own prior HA history.
- In Chart settings → Symbol, use the real-price scale option when you need the actual price label. Changing that label does not turn the HA candle body into ordinary OHLC.
- Check indicator sources too. A script using the chart's close on an HA chart receives an HA close unless it explicitly requests another data source. A moving average can change even if its length stays the same.
- Treat the open candle as provisional. Its close and extremes can change before the interval ends, so a currently green HA candle is not a confirmed closed-bar signal.
Bars B and D stay green while the market close falls
Use standard candles when the task is to locate a recorded gap, measure a market-price wick or define an order level. Add HA when you want to compare the persistence of a smoothed body direction. Our example exposes the cost of that smoothing: the down bars B and D disappear from the color sequence. It does not establish which view will make better trading decisions.
- An HA value may happen to coincide with a tradable price, but the formula does not establish that it traded at the relevant time. Even a standard bar's close is historical information, not a guaranteed fill for an order sent afterward.
- Use current broker quotes and the order's execution rules for orders. For historical strategy fills, continue with the linked Heikin Ashi backtesting guide, which covers standard OHLC fill settings and their remaining limits.
- For a custom comparison display, ask Pineify's Pine Script AI Coding Agent to draft separate standard and HA readings for the same symbol and timeframe, with clearly named values. Review the source, validate syntax, and compare completed-bar outputs in TradingView before adding order logic.