Heikin Ashi candles: the formula and how to calculate them (with Excel)
Heikin Ashi candles are normal candles redrawn with averaged prices. Here are the four formulas that turn normal candles into the Heikin Ashi open, high, low and close, what the colour and wicks mean, and how they differ from normal candles — with a worked example, the Excel formulas, a free Excel sheet and a box to convert your own OHLC candles.
Last updated:
Needs: open, high, low, close
The Heikin Ashi formula
HA close = (Open + High + Low + Close) ÷ 4
HA open = (previous HA open + previous HA close) ÷ 2
first candle: (Open + Close) ÷ 2
HA high = the highest of High, HA open and HA close
HA low = the lowest of Low, HA open and HA close“Heikin Ashi” is Japanese for “average bar”: each candle is an average of its own prices, and each open is carried over from the previous candle, which makes the chart smoother than normal candles.
How to calculate Heikin Ashi step by step
- HA close: average the candle's four prices. Day 1: (1,002.35 + 1,010.00 + 990.60 + 1,001.15) ÷ 4 = 1,001.0250.
- HA open of the first candle: halfway between its open and close. (1,002.35 + 1,001.15) ÷ 2 = 1,001.7500.
- HA high and HA low. Day 1's HA high is the largest of 1,010.00, 1,001.7500 and 1,001.0250 = 1,010.0000; its HA low is the smallest of 990.60, 1,001.7500 and 1,001.0250 = 990.6000.
- From the second candle, carry the open over. Day 2's HA open = (1,001.7500 + 1,001.0250) ÷ 2 = 1,001.3875, and its HA close = 994.8750.
- Repeat for every candle. Day 60's Heikin Ashi candle: open 980.4028, high 1,015.1500, low 980.4028, close 1,002.3250.
Worked example — and calculate Heikin Ashi from your own prices
The table works through 60 daily candles of an imaginary stock, column by column — the same columns as the Excel sheet. To calculate Heikin Ashi for your own stock, clear the box and paste your open, high, low, close from Excel or your broker's download.
Latest values
| Day | Open | High | Low | Close | HA open | HA high | HA low | HA close |
|---|---|---|---|---|---|---|---|---|
| Day 1 | 1,002.35 | 1,010.00 | 990.60 | 1,001.15 | 1,001.7500 | 1,010.0000 | 990.6000 | 1,001.0250 |
| Day 2 | 999.20 | 1,004.60 | 987.75 | 987.95 | 1,001.3875 | 1,004.6000 | 987.7500 | 994.8750 |
| Day 3 | 986.15 | 1,011.50 | 986.00 | 1,009.15 | 998.1313 | 1,011.5000 | 986.0000 | 998.2000 |
| Day 4 | 1,007.80 | 1,015.00 | 1,001.85 | 1,012.60 | 998.1656 | 1,015.0000 | 998.1656 | 1,009.3125 |
| Day 5 | 1,010.45 | 1,012.00 | 990.80 | 993.25 | 1,003.7391 | 1,012.0000 | 990.8000 | 1,001.6250 |
| Day 6 | 995.65 | 1,012.60 | 990.90 | 1,008.60 | 1,002.6820 | 1,012.6000 | 990.9000 | 1,001.9375 |
| Day 7 | 1,009.20 | 1,018.95 | 1,003.80 | 1,013.60 | 1,002.3098 | 1,018.9500 | 1,002.3098 | 1,011.3875 |
| Day 8 | 1,012.00 | 1,012.95 | 994.75 | 1,001.55 | 1,006.8486 | 1,012.9500 | 994.7500 | 1,005.3125 |
| Day 9 | 1,000.35 | 1,033.25 | 995.30 | 1,031.55 | 1,006.0806 | 1,033.2500 | 995.3000 | 1,015.1125 |
| Day 10 | 1,031.45 | 1,046.15 | 1,028.50 | 1,040.05 | 1,010.5965 | 1,046.1500 | 1,010.5965 | 1,036.5375 |
| Day 11 | 1,038.15 | 1,041.80 | 1,027.70 | 1,033.15 | 1,023.5670 | 1,041.8000 | 1,023.5670 | 1,035.2000 |
| Day 12 | 1,037.15 | 1,065.80 | 1,031.15 | 1,064.80 | 1,029.3835 | 1,065.8000 | 1,029.3835 | 1,049.7250 |
| Day 13 | 1,060.65 | 1,086.00 | 1,056.85 | 1,083.55 | 1,039.5543 | 1,086.0000 | 1,039.5543 | 1,071.7625 |
| Day 14 | 1,084.55 | 1,090.25 | 1,067.25 | 1,067.95 | 1,055.6584 | 1,090.2500 | 1,055.6584 | 1,077.5000 |
| Day 15 | 1,071.20 | 1,074.30 | 1,061.45 | 1,063.50 | 1,066.5792 | 1,074.3000 | 1,061.4500 | 1,067.6125 |
| Day 16 | 1,066.25 | 1,067.35 | 1,025.90 | 1,030.20 | 1,067.0958 | 1,067.3500 | 1,025.9000 | 1,047.4250 |
| Day 17 | 1,028.70 | 1,033.00 | 1,011.75 | 1,012.20 | 1,057.2604 | 1,057.2604 | 1,011.7500 | 1,021.4125 |
| Day 18 | 1,015.90 | 1,019.90 | 979.85 | 981.60 | 1,039.3365 | 1,039.3365 | 979.8500 | 999.3125 |
| Day 19 | 981.60 | 988.30 | 969.40 | 970.55 | 1,019.3245 | 1,019.3245 | 969.4000 | 977.4625 |
| Day 20 | 971.00 | 973.10 | 959.05 | 960.90 | 998.3935 | 998.3935 | 959.0500 | 966.0125 |
| Day 21 | 960.00 | 980.35 | 958.30 | 978.30 | 982.2030 | 982.2030 | 958.3000 | 969.2375 |
| Day 22 | 981.35 | 981.50 | 957.00 | 958.85 | 975.7202 | 981.5000 | 957.0000 | 969.6750 |
| Day 23 | 958.80 | 963.00 | 942.60 | 946.75 | 972.6976 | 972.6976 | 942.6000 | 952.7875 |
| Day 24 | 949.40 | 957.70 | 931.65 | 937.95 | 962.7426 | 962.7426 | 931.6500 | 944.1750 |
| Day 25 | 936.60 | 945.75 | 926.05 | 927.85 | 953.4588 | 953.4588 | 926.0500 | 934.0625 |
| Day 26 | 924.25 | 924.60 | 910.25 | 911.20 | 943.7606 | 943.7606 | 910.2500 | 917.5750 |
| Day 27 | 912.10 | 919.05 | 900.00 | 905.15 | 930.6678 | 930.6678 | 900.0000 | 909.0750 |
| Day 28 | 901.60 | 904.50 | 884.70 | 885.95 | 919.8714 | 919.8714 | 884.7000 | 894.1875 |
| Day 29 | 885.85 | 891.25 | 871.55 | 874.70 | 907.0295 | 907.0295 | 871.5500 | 880.8375 |
| Day 30 | 876.55 | 880.70 | 849.70 | 855.80 | 893.9335 | 893.9335 | 849.7000 | 865.6875 |
| Day 31 | 858.30 | 868.95 | 858.15 | 862.15 | 879.8105 | 879.8105 | 858.1500 | 861.8875 |
| Day 32 | 861.35 | 875.05 | 859.50 | 866.45 | 870.8490 | 875.0500 | 859.5000 | 865.5875 |
| Day 33 | 866.85 | 870.55 | 843.00 | 845.10 | 868.2182 | 870.5500 | 843.0000 | 856.3750 |
| Day 34 | 846.70 | 854.70 | 846.55 | 851.55 | 862.2966 | 862.2966 | 846.5500 | 849.8750 |
| Day 35 | 849.20 | 863.70 | 847.85 | 860.20 | 856.0858 | 863.7000 | 847.8500 | 855.2375 |
| Day 36 | 857.85 | 862.95 | 845.40 | 854.80 | 855.6617 | 862.9500 | 845.4000 | 855.2500 |
| Day 37 | 858.20 | 882.25 | 858.05 | 877.20 | 855.4558 | 882.2500 | 855.4558 | 868.9250 |
| Day 38 | 877.05 | 893.65 | 868.85 | 888.45 | 862.1904 | 893.6500 | 862.1904 | 882.0000 |
| Day 39 | 890.40 | 908.35 | 889.60 | 905.40 | 872.0952 | 908.3500 | 872.0952 | 898.4375 |
| Day 40 | 907.95 | 913.10 | 895.65 | 896.80 | 885.2664 | 913.1000 | 885.2664 | 903.3750 |
| Day 41 | 893.65 | 894.65 | 887.85 | 889.60 | 894.3207 | 894.6500 | 887.8500 | 891.4375 |
| Day 42 | 887.10 | 898.55 | 884.80 | 895.30 | 892.8791 | 898.5500 | 884.8000 | 891.4375 |
| Day 43 | 895.30 | 920.60 | 889.25 | 919.00 | 892.1583 | 920.6000 | 889.2500 | 906.0375 |
| Day 44 | 917.70 | 920.60 | 916.30 | 918.35 | 899.0979 | 920.6000 | 899.0979 | 918.2375 |
| Day 45 | 916.60 | 919.30 | 903.80 | 906.25 | 908.6677 | 919.3000 | 903.8000 | 911.4875 |
| Day 46 | 903.75 | 937.35 | 900.30 | 932.10 | 910.0776 | 937.3500 | 900.3000 | 918.3750 |
| Day 47 | 935.25 | 947.15 | 930.20 | 944.35 | 914.2263 | 947.1500 | 914.2263 | 939.2375 |
| Day 48 | 943.20 | 949.20 | 937.25 | 948.70 | 926.7319 | 949.2000 | 926.7319 | 944.5875 |
| Day 49 | 950.55 | 971.15 | 949.05 | 966.35 | 935.6597 | 971.1500 | 935.6597 | 959.2750 |
| Day 50 | 965.45 | 965.90 | 954.75 | 955.60 | 947.4673 | 965.9000 | 947.4673 | 960.4250 |
| Day 51 | 956.10 | 971.35 | 954.15 | 969.10 | 953.9462 | 971.3500 | 953.9462 | 962.6750 |
| Day 52 | 968.00 | 997.00 | 966.55 | 984.35 | 958.3106 | 997.0000 | 958.3106 | 978.9750 |
| Day 53 | 986.40 | 992.30 | 980.25 | 980.90 | 968.6428 | 992.3000 | 968.6428 | 984.9625 |
| Day 54 | 979.40 | 984.70 | 961.40 | 962.50 | 976.8026 | 984.7000 | 961.4000 | 972.0000 |
| Day 55 | 960.05 | 964.60 | 953.00 | 960.20 | 974.4013 | 974.4013 | 953.0000 | 959.4625 |
| Day 56 | 956.65 | 969.05 | 954.50 | 967.35 | 966.9319 | 969.0500 | 954.5000 | 961.8875 |
| Day 57 | 965.05 | 982.20 | 960.60 | 971.00 | 964.4097 | 982.2000 | 960.6000 | 969.7125 |
| Day 58 | 973.90 | 987.10 | 967.55 | 981.75 | 967.0611 | 987.1000 | 967.0611 | 977.5750 |
| Day 59 | 980.15 | 999.95 | 979.00 | 994.85 | 972.3181 | 999.9500 | 972.3181 | 988.4875 |
| Day 60 | 994.45 | 1,015.15 | 987.35 | 1,012.35 | 980.4028 | 1,015.1500 | 980.4028 | 1,002.3250 |
The example prices are made up for this page — they are not real market data. Heikin Ashi is a calculation from past prices, not a forecast, a signal or advice to buy or sell. MyAlgoMate provides trading technology, not investment advice.
How to calculate Heikin Ashi in Excel
Put the headings in row 1 and the first candle in row 2, oldest at the top. Then type these formulas — each column uses the ones to its left:
- A
Day
A2 downwards: your dates, oldest at the top.
- B
Open
B2 downwards: the open prices, oldest at the top.
- C
High
C2 downwards: the high prices, oldest at the top.
- D
Low
D2 downwards: the low prices, oldest at the top.
- E
Close
E2 downwards: the closing prices, oldest at the top.
- F
HA open
F2
=(B2+E2)/2— this cell only (the starting value).F3
=(F2+I2)/2— then copy it down to the last row. - G
HA high
G2
=MAX(C2,F2,I2)— then copy it down to the last row. - H
HA low
H2
=MIN(D2,F2,I2)— then copy it down to the last row. - I
HA close
I2
=(B2+C2+D2+E2)/4— then copy it down to the last row.
Only the first HA open (F2) uses a different formula; everything else is copied down from row 2 or 3.
Prefer not to type them? The free sheet has every formula filled in for the example prices — replace the prices with yours and extend the rows. It opens in Microsoft Excel (we checked every value against the table above), and you can import it into Google Sheets or LibreOffice.
Download the free Heikin Ashi Excel sheet (.xlsx)What changes on a Heikin Ashi chart
Because every value is an average, Heikin Ashi candles move more smoothly than normal ones and hide some of the back-and-forth inside a run of candles. The trade-off is that the prices on the chart are no longer the real open, high, low and close. Heikin Ashi is a different way of drawing past prices — not a forecast or advice.
How a Heikin Ashi candle gets its colour and wicks
- Colour. Green (or hollow) when the HA close is above the HA open, red (or filled) when it is below. In the example, 29 of the 60 Heikin Ashi candles are green and 31 red.
- No lower wick on a green candle. The HA low is the lowest of the real low, the HA open and the HA close. When the HA open is at or below the real low, the HA low is the HA open, so the body starts at the bottom of the candle. 22of the example's green candles look like this.
- No upper wick on a red candle. The same at the top: when the HA open is at or above the real high, the HA high is the HA open. 16of the example's red candles look like this.
- Small body, long wicks on both sides. The HA open and HA close are close together while the real high and low are far apart — the averages barely moved while the price swung both ways.
These are descriptions of how the candle is built, not readings of what the price will do.
Heikin Ashi vs normal candles
| Normal candle | Heikin Ashi candle | |
|---|---|---|
| Open | The first traded price of the period | Midpoint of the previous HA body: (prev HA open + prev HA close) ÷ 2 |
| Close | The last traded price of the period | Average of the period's open, high, low and close |
| High / low | The real highest and lowest price | Real high / low, stretched to include the HA open and HA close |
| Real prices? | Yes | No — averages (the HA high or low can equal the real one) |
| Gaps between periods | Shown | Not shown — each body starts inside the previous one |
| Depends on earlier candles? | No | Yes — every HA open is carried over from the candle before |
| Time | One candle per period | One candle per period (unlike Renko) |
Heikin Ashi vs Renko. Both look smoother than normal candles, but in different ways. Heikin Ashi still draws one candle for every period, just with averaged prices. Renko ignores time: it adds a fixed-size brick only when the price has moved by the brick size.
Why there are no gaps, and how long the first candle matters
Each HA open is the midpoint of the previous Heikin Ashi body, so every new body starts inside the one before it. A real gap between two sessions — say a stock opening well above yesterday's close — never shows as empty space on a Heikin Ashi chart; it only shows up inside the averages.
The same carry-over explains why two charts that start on different days disagree at first. The HA close does not depend on the HA open, so any difference in the starting HA open is exactly halved on every candle:
| Candles later | Difference left |
|---|---|
| 1 | 50.0% |
| 3 | 12.5% |
| 5 | 3.1% |
| 7 | 0.78% |
| 10 | 0.10% |
After about seven candles less than 1% of the difference is left, so two charts usually agree by then. The HA high and low follow, because they are built from the HA open.
What Heikin Ashi hides
- The real prices. The HA open and close are averages, so the chart does not show where the price actually opened or closed.
- Gaps. They are smoothed into the averages (see above).
- Timing. Each value averages earlier prices, so a change of colour comes after the price has already moved.
- The live candle. Until the period closes, the HA close (and so the colour) keeps changing with every new price.
If you use Heikin Ashi values in alerts or automation — for example TradingView alerts sent to your broker — remember that orders are always filled at real market prices, not at Heikin Ashi prices.
Heikin Ashi calculation — questions, answered.
HA close = (Open + High + Low + Close) ÷ 4. HA open = (previous HA open + previous HA close) ÷ 2, and for the very first candle (Open + Close) ÷ 2. HA high = the highest of the High, the HA open and the HA close; HA low = the lowest of the Low, the HA open and the HA close.
HA open = (previous HA open + previous HA close) ÷ 2 — the midpoint of the previous Heikin Ashi candle's body. The first candle has no previous HA candle, so its HA open is (Open + Close) ÷ 2 of the normal candle.
Open, high, low and close in columns B to E from row 2. HA close in I2: =(B2+C2+D2+E2)/4. HA open in F2: =(B2+E2)/2, then from F3: =(F2+I2)/2. HA high in G2: =MAX(C2,F2,I2); HA low in H2: =MIN(D2,F2,I2). Copy everything down.
Heikin Ashi candles are a different way of drawing the same price history. Each candle's close is the average of the normal candle's open, high, low and close, and each open is the midpoint of the previous Heikin Ashi candle's body. The chart looks smoother than normal candlesticks, but its prices are averages, not real traded prices.
Only how its two averages compare: it is drawn green (or hollow) when the HA close is above the HA open, and red (or filled) when it is below. Because both are averages of earlier prices, the colour changes after the price has already moved. It describes past prices, not what comes next.
HA low is the lowest of the real low, the HA open and the HA close. When the HA open is at or below the real low, the HA low equals the HA open and a green candle has no lower wick. On a red candle the same happens at the top: when the HA open is at or above the real high, there is no upper wick.
No. It is an average of the candle's four prices, so it is usually not a price anything actually traded at. Orders are filled at real market prices, so if you automate anything, the price that matters is the normal candle's, not the Heikin Ashi one.
Each HA open depends on the one before it, all the way back to the first candle, so the starting point matters — the difference fades after a few candles. Spot vs futures prices and the timeframe change them too.
More indicator formulas, with Excel sheets
Turn your own rules into automated orders.
Already use Heikin Ashi in your own rules? MyAlgoMate's algo trading software places the orders your rules call for at 150+ Indian brokers — and TradeBridge turns your own TradingView or Chartink alerts into live orders. You decide the rules; we provide the technology.