Strategies we backtested Heikin Ashi colour change strategy

Tested by BacktestingMax

Heikin Ashi colour change strategy backtest

Does the Heikin Ashi colour change strategy make money?

Mostly no. With the standard rules, only 5 of our 32 backtests made money from 2014 to 2025, after trading costs, all on 4-hour or daily charts. We tested 8 markets (3 currency pairs, gold, silver and 3 stock indices), each on 15-minute, 1-hour, 4-hour and daily charts. Every trade opened and closed at real prices: prices the market actually traded at. Heikin Ashi candles are smoothed candles, worked out from averages of the real prices. The standard rules buy when two green (bullish) Heikin Ashi candles follow a red one, sell short (sell first, to make money if price falls) when two red candles follow a green one, and close at the first candle of the other colour. On daily charts, 3 of the 8 markets made money. On 15-minute and 1-hour charts, all 16 backtests lost more than 90%, the 10 on currencies, gold and silver too. In a re-run of every signal before costs, at Heikin Ashi prices (averages the market often never traded at), 53% of the trades won and all 32 tests made money. At real prices, 30% won and 17 tests made money. Of three common changes we tried, none clearly helped. The one we picked, a higher-timeframe filter, trades only when the last finished Heikin Ashi candle on the next higher chart is green for a buy or red for a sell. With it, 5 tests made money in both 2014–2021 and 2022–2025, the same as with the standard rules, but 2 daily tests passed all four of our checks, compared with none. Overnight fees, which brokers charge or pay for each night a trade stays open, are not included.

32 backtests 2014–2025 Trading costs included Tested 19 October 2026

Where it worked 32 backtests
Made money
5
of 32 tests, using the standard rules
Made money in both periods
5
2014–2021 and again 2022–2025
Best backtest
+229%
USD/JPY, 4-hour chart: account growth 2014–2025
With a higher-timeframe Heikin Ashi filter
5
tests made money in both periods, compared with 5 using the standard rules

Made money in both periods

  • GBP/USD, daily
  • USD/JPY, 4-hour
  • Gold, daily
  • Nasdaq 100, daily
  • DAX, 4-hour

Lost money on every market

  • 15-minute charts
  • 1-hour charts

The results

Results on every market

Each box shows one backtest of the Heikin Ashi colour change strategy using the standard rules, from 2014 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2014–2021 and 2022–2025, or passed all four of our checks (see "How a test passes" further down).

Market 15-minute 1-hour 4-hour daily
EUR/USD −100% Lost money. Account down 90% by Mar 2014 −100% Lost money. Account down 90% by Nov 2015 −90% Lost money. Account down 90% by Nov 2025 −15% Lost money
GBP/USD −100% Lost money. Account down 90% by Mar 2014 −100% Lost money. Account down 90% by Dec 2014 −59% Lost money +21% Made money in both periods
USD/JPY −100% Lost money. Account down 90% by Apr 2014 −100% Lost money. Account down 90% by Mar 2016 +229% Made money in both periods −26% Lost money
Gold −100% Lost money. Account down 90% by Feb 2014 −100% Lost money. Account down 90% by Apr 2015 −64% Lost money +48% Made money in both periods
Silver −100% Lost money. Account down 90% by Jan 2014 −100% Lost money. Account down 90% by May 2014 −99% Lost money. Account down 90% by Jan 2016 −27% Lost money
Nasdaq 100 −100% Lost money. Account down 90% by Feb 2014 −100% Lost money. Account down 90% by May 2014 −8% Lost money +39% Made money in both periods
S&P 500 −100% Lost money. Account down 90% by Mar 2014 −100% Lost money. Account down 90% by Jun 2014 −92% Lost money. Account down 90% by Jan 2023 −11% Lost money
DAX −100% Lost money. Account down 90% by May 2014 −99% Lost money. Account down 90% by Jan 2016 +178% Made money in both periods −30% Lost money
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2014–2021 2022–2025 Monte Carlo drawdown Trading costs
EUR/USD 15-minute 3,186 21.8% 0.52 −99.7% −99.7% −99.7% −1.7% −99.7% $5,978
EUR/USD 1-hour 4,197 24.4% 0.73 −99.7% −99.7% −99.6% −8.9% −99.8% $6,347
EUR/USD 4-hour 3,485 29% 0.89 −90.3% −91.0% −71.6% −65.9% −95.2% $7,582
EUR/USD daily 601 33.3% 0.94 −14.5% −25.6% +8.8% −21.4% −45.5% $881
GBP/USD 15-minute 2,434 21.6% 0.60 −99.6% −99.7% −99.6% −6.8% −99.7% $8,139
GBP/USD 1-hour 3,651 24.4% 0.67 −99.6% −99.6% −99.6% −0.8% −99.8% $6,240
GBP/USD 4-hour 3,453 28.9% 0.96 −59.4% −73.9% −10.4% −54.7% −89.0% $13,204
GBP/USD daily 589 34.3% 1.08 +21.2% −17.3% +14.4% +6.0% −39.8% $1,168
USD/JPY 15-minute 2,913 24% 0.70 −99.7% −99.7% −99.7% 0.0% −99.7% $10,169
USD/JPY 1-hour 6,127 26% 0.82 −99.7% −99.7% −99.7% 0.0% −99.8% $10,340
USD/JPY 4-hour 3,496 31.5% 1.06 +229.3% −45.5% +134.4% +40.4% −70.7% $33,110
USD/JPY daily 613 29.7% 0.91 −26.0% −37.1% −23.7% −3.1% −55.8% $1,000
Gold 15-minute 1,557 21.4% 0.52 −99.7% −99.7% −99.7% 0.0% −99.8% $9,483
Gold 1-hour 3,293 23.9% 0.74 −99.5% −99.5% −99.5% 0.0% −99.8% $11,027
Gold 4-hour 3,378 29% 0.93 −64.0% −85.7% −75.7% +48.4% −89.7% $12,840
Gold daily 562 33.6% 1.16 +48.4% −28.6% +13.9% +30.3% −37.3% $1,795
Silver 15-minute 614 18.4% 0.27 −99.8% −99.8% −99.8% 0.0% −99.8% $10,708
Silver 1-hour 744 16.8% 0.38 −99.8% −99.8% −99.8% 0.0% −99.8% $8,174
Silver 4-hour 1,204 18.6% 0.55 −99.3% −99.4% −98.9% −37.7% −99.5% $8,048
Silver daily 578 30.4% 0.90 −26.6% −36.0% −17.8% −10.7% −55.0% $4,493
Nasdaq 100 15-minute 926 18.5% 0.28 −99.9% −99.9% −99.9% 0.0% −99.9% $9,575
Nasdaq 100 1-hour 1,309 17.4% 0.35 −99.9% −99.9% −99.9% 0.0% −99.9% $7,092
Nasdaq 100 4-hour 3,278 30% 0.99 −7.6% −77.9% −44.7% +67.1% −86.7% $12,777
Nasdaq 100 daily 574 35.5% 1.12 +38.6% −18.0% +24.6% +11.2% −41.0% $1,565
S&P 500 15-minute 1,965 20.2% 0.51 −99.9% −99.9% −99.9% 0.0% −100.0% $9,493
S&P 500 1-hour 2,076 22.2% 0.44 −99.9% −99.9% −99.9% 0.0% −99.9% $5,688
S&P 500 4-hour 3,281 28.6% 0.80 −91.7% −92.4% −85.7% −41.9% −96.5% $6,113
S&P 500 daily 569 32.9% 0.96 −11.2% −44.6% +9.3% −18.7% −47.4% $1,440
DAX 15-minute 3,220 22.8% 0.77 −99.7% −99.7% −99.7% 0.0% −99.8% $13,517
DAX 1-hour 5,535 24.4% 0.80 −98.9% −99.0% −97.6% −54.4% −99.8% $6,075
DAX 4-hour 3,233 30.8% 1.08 +177.9% −65.8% +5.7% +162.9% −75.2% $10,264
DAX daily 571 34.5% 0.88 −30.3% −47.6% −15.9% −17.2% −55.6% $512

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2014–2021 and 2022–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test USD/JPY, 4-hour chart +229.3% from 2014 to 2025
Middle test (median): half of the 32 did better, half did worse DAX, 1-hour chart −98.9% from 2014 to 2025

What we found

What the 32 backtests show

  1. On daily charts, the colour change strategy made money on 3 of the 8 markets. The account results from 2014 to 2025, after trading costs, were: gold +48.4%, the Nasdaq 100 +38.6% and GBP/USD +21.2%. All 3 made money in 2014–2021 and again in 2022–2025. On 4-hour charts, only USD/JPY (+229.3%) and the DAX (+177.9%) made money, but they were the two best tests, and both made money in both periods. Only about 1 trade in 3 won on daily charts (33.0%), and 29.1% on 4-hour charts. With the standard rules, no test passed all four of our checks (see 'How a test passes' further down). For all 5 tests that made money, when we shuffled their trades into a random order 1,000 times, the worst 5% of the orders had a drawdown (a fall from the highest balance) of 37.3% or more, above our limit of 30%.

  2. Be careful with the index results on 4-hour charts. Before mid-2018, our S&P 500, Nasdaq 100 and DAX data has almost no price changes overnight, so in those hours it may not show how these markets really moved. R is 1% of the account at the time of the trade: the money a trade normally risks. On the Nasdaq 100 4-hour chart, the trades that closed before 1 July 2018 lost 113.1R, and the later trades made +191.4R. The account was down 74.2% by then, so the later trades were much smaller, and the test still ended 7.6% down. On the S&P 500 4-hour chart, the trades lost 181.4R before 1 July 2018 and 5.1R after it. On the DAX 4-hour chart, the 344 trades that closed before 1 July 2018 and opened or closed between 20:00 and 22:59 UTC, around the start of those flat hours, made +34.4R. Without them, the DAX 4-hour trades made only +4.8R in 2014–2021. The DAX's best trade, a buy in January 2025, had its stop-loss only 3.6 points away, so it was as large as the 30 times leverage limit allowed. It made 100.2R and doubled the account: more than all the other DAX 4-hour trades together (+87.6R).

  3. A backtest that opens and closes trades at Heikin Ashi prices looks much better than ours. The Heikin Ashi open is halfway between the open and the close of the previous Heikin Ashi candle: an average, and often a price the market never traded at. We ran the signals of all 32 tests again, before trading costs, twice: once at real prices, as in our backtests, and once at Heikin Ashi prices, as a backtest can do when it runs on a Heikin Ashi chart. At Heikin Ashi prices, 53.1% of the trades won and all 32 tests made money. At real prices, 29.7% of the trades won and 17 of the 32 tests made money (see 'Heikin Ashi prices against real prices' below).

  4. On 15-minute and 1-hour charts, all 16 backtests lost more than 90% of their starting balance: the 15-minute ones by May 2014, in the first 5 months of the test, and the 1-hour ones by March 2016. The 6 tests on the stock indices fell that far between February 2014 and January 2016, in the years of flat overnight index data, but all 10 tests on currencies, gold and silver lost more than 90% too. Less than 25% of the trades won, and even before trading costs, these signals made almost nothing: in the re-run at real prices, over all 12 years, the average trade was −0.02R on 15-minute charts and 0.00R on 1-hour charts. The candles are small, so the stop-loss is close to the entry price (on EUR/USD 15-minute charts, half of the stop-losses were 5.2 pips, 0.00052, or less away), and a trade that risks 1% is large. So its trading cost is large compared with the 1% it risks. On average, trading costs took 23.7% of the money each 15-minute trade risked, and 13.9% on 1-hour charts, compared with 4.9% on 4-hour charts and 2.7% on daily charts.

  5. On daily charts, the buys did better than the sells on all 8 markets, even on EUR/USD and GBP/USD, whose prices fell from 2014 to 2025. On EUR/USD, the daily buys made +12.2R and the sells lost 22.4R. On GBP/USD, the buys made +18.2R and the sells +8.9R (see the table below). We noticed this after seeing these results, so trading only the buys is an idea to test, not a result.

Heikin Ashi prices against real prices

At Heikin Ashi prices, the same signals looked like a winning strategy

We ran the signals of all 32 tests again, from 2014 to 2025, before trading costs. The first run used real prices, as in our backtests: a trade opens at the real open of the next candle, its stop-loss is the real low or high of the two signal candles, and it closes at the real open of the candle after the first candle of the other colour. The second run used Heikin Ashi prices, as a backtest can do when it runs on a Heikin Ashi chart: a trade opens at the next Heikin Ashi open, its stop-loss is the Heikin Ashi low or high of the two signal candles, and it closes at a Heikin Ashi open too. R is 1% of the account at the time of the trade: the money a trade normally risks.

Trades that won, at Heikin Ashi prices
53.1%
of 580,812 trades. All 32 tests made money.
Trades that won, at real prices
29.7%
of 575,846 trades. 17 of the 32 tests made money.
Average trade, at Heikin Ashi prices
+0.47R
before trading costs
Average trade, at real prices
−0.01R
before trading costs

The difference between the two runs was about the same on every chart. The share of trades that won was 53.4% at Heikin Ashi prices and 29.7% at real prices on 15-minute charts, 51.5% and 29.3% on 1-hour charts, 53.3% and 30.4% on 4-hour charts, and 56.4% and 33.6% on daily charts. After a colour change, the Heikin Ashi open is still behind the real price. So a backtest at Heikin Ashi prices often buys lower and sells higher than the real open: the Heikin Ashi entry price was better than the real one in 79% of the trades. In 40% of the trades at Heikin Ashi prices, the entry price was better than any price the market traded at during that candle: below the real low of the candle for a buy, or above its real high for a sell. For example, on EUR/USD, after two green Heikin Ashi daily candles (a buy signal), the Heikin Ashi open on Monday 19 February 2024 was 1.07556. But EUR/USD did not go below 1.07621 that day, so nobody could buy at the Heikin Ashi open. The real-price run has fewer trades: it skipped 4,966 signals where the second signal candle closed exactly at the stop-loss price. The test works out the trade size when the signal candle closes, from the distance between that close and the stop-loss, and there that distance was zero. Both runs skip the tiny Friday candles (see 'Price data' further down), and both are before trading costs: with costs, only 5 of the 32 backtests made money.

Buys against sells

On daily charts, the buys did better than the sells on all 8 markets

This table shows the daily trades of the standard rules, from 2014 to 2025, after trading costs. The results are in R: 1% of the account at the time of the trade, the money a trade normally risks. For example, +65.6R for the gold buys means that the 283 gold buys made, together, 65.6 times 1% of the account. The last column shows how much each market's price changed from the start of 2014 to the end of 2025.

Market Buys Sells Price change, 2014–2025
EUR/USD +12.2R (295 trades) −22.4R (306 trades) −14.1%
GBP/USD +18.2R (289 trades) +8.9R (300 trades) −18.1%
USD/JPY +24.8R (309 trades) −46.1R (304 trades) +49.5%
Gold +65.6R (283 trades) −17.0R (279 trades) +252.8%
Silver +11.9R (296 trades) −34.7R (282 trades) +257.8%
Nasdaq 100 +30.7R (304 trades) +11.8R (270 trades) +603.2%
S&P 500 +29.7R (299 trades) −33.9R (270 trades) +270.6%
DAX −1.2R (303 trades) −26.9R (268 trades) +156.4%
All 8 markets +192.0R (2,378 trades) −160.5R (2,279 trades)

If you traded only the buys, you would get the same buy trades as in this table, with the same results in R. This is because, with the standard rules, a sell always closes before the next buy opens: the first green Heikin Ashi candle closes the sell. The R totals don't match the % results in the grid above, because each trade risks 1% of the balance at that time, and some trades risked less than 1% (see 'Risk per trade').

The strategy

What the Heikin Ashi colour change strategy is

Heikin Ashi is a way to draw candles that smooths out the price, so that a trend is easier to see. Each Heikin Ashi candle is worked out from the real candle at the same time and from the Heikin Ashi candle before it. Its close is the average of the real open, high, low and close. Its open is halfway between the open and the close of the previous Heikin Ashi candle. Its high is the highest of the real high, the Heikin Ashi open and the Heikin Ashi close, and its low is the lowest of the real low, the Heikin Ashi open and the Heikin Ashi close. Like a normal candle, a Heikin Ashi candle has a body, the thick part between its open and its close, and wicks, the thin lines above and below the body that reach its high and its low. A Heikin Ashi candle is bullish when its close is above its open (most charts draw it green), and bearish when its close is below its open (red). Because each candle uses averages, Heikin Ashi candles change colour less often than normal candles, and several candles of the same colour in a row show a trend. The colour change strategy trades when the colour changes and the next candle has the new colour too. The Heikin Ashi open and close are averages, so they are often prices the market never traded at. In our test, the Heikin Ashi candles only decide when to trade: every trade opens, closes and hits its stop-loss at real prices.

Heikin Ashi
The standard formula, worked out from the real candles of each chart. It has no settings to choose.
Prices used
Real prices for every trade: the entry, the exit and the stop-loss. The Heikin Ashi candles only decide when to trade.
Stop-loss
The real low (for a buy) or high (for a sell) of the two signal candles. It does not move. On each type of chart (15-minute, 1-hour, 4-hour and daily), half of the stop-losses were closer to the entry price than the size of an average candle, from its high to its low.
Exit
At the real open of the candle after the first Heikin Ashi candle of the other colour.
Take-profit
None
Risk per trade
1% of the account at the time of the trade. When the stop-loss was so close that a 1% risk needed more than 30 times leverage (a trade worth more than 30 times the account), the trade was made smaller, so it risked less than 1%. This happened to about 1 signal in 5 on 15-minute charts, 1 in 14 on 1-hour charts, 1 in 50 on 4-hour charts, and almost never on daily charts. When a trade that risks 1% would be smaller than the smallest trade the market allows, the test skipped the trade.
Trading costs
The spread, the difference between the buy price and the sell price, paid on every trade. We used a fixed spread: 0.8 pips on EUR/USD, 1.2 pips on GBP/USD and 0.9 pips on USD/JPY (a pip is 0.0001 on EUR/USD and GBP/USD, and 0.01 on USD/JPY), $0.30 per ounce on gold, $0.020 per ounce on silver, 1.5 points on the Nasdaq 100, 0.4 points on the S&P 500 and 1.0 point on the DAX. Real spreads are often wider at night and around news. No commission.
Overnight (swap) fees
Not included. Brokers charge, or sometimes pay, a fee for each night a trade stays open. Half of the trades stayed open 12 hours or longer on 4-hour charts, and 4 days or longer on daily charts, weekends included.
Price data
CFD prices: the prices a broker quotes for trading each market. From 2014 to 2018, on about 33 Fridays a year, our S&P 500 and Nasdaq 100 data has a few minutes of prices after the weekly close at 17:00 New York time, and these make a tiny extra candle. The DAX and silver data have a few of them too. The strategy leaves out every candle that opens on a Friday at 17:00 New York time or later, on every chart: it does not use these candles to work out the Heikin Ashi candles, and it never takes a signal or closes a trade because of them. A trade signalled on the Friday can still open or close at the first price of such a candle. A tiny candle changes the Heikin Ashi candles after it, so it can start or end a trade on a day when the real chart gave no signal. Before we left these candles out, the S&P 500 daily test showed +16.4%; now it shows −11.2%. The Nasdaq 100 daily test went from +89.7% to +38.6%. Before mid-2018, our S&P 500, Nasdaq 100 and DAX data also has almost no price changes overnight, from about 22:00 to 06:00 UTC (from 21:00 for the DAX), so the index results in those years are less certain (see 'What we found').

The rules we tested

  1. Work out a Heikin Ashi candle for every candle on the chart, and check its colour when the real candle closes. Until then, the Heikin Ashi candle can still change colour, so the strategy only reads closed candles. It leaves out any candle that opens on a Friday at 17:00 New York time or later (see 'Price data').
  2. Buy when two green (bullish) Heikin Ashi candles in a row follow a red (bearish) one. These two green candles are the signal candles. The trade opens at the real open of the next candle.
  3. Sell short when two red Heikin Ashi candles in a row follow a green one. These two red candles are the signal candles. Selling short means you sell first and buy back later, so the trade makes money if price falls. The trade opens at the real open of the next candle.
  4. Put the stop-loss at the lowest real price of the two signal candles for a buy, or at the highest real price of the two signal candles for a sell. The stop-loss does not move. If a candle opens past the stop-loss (a gap, for example after a weekend), the trade closes at that worse opening price.
  5. When the first Heikin Ashi candle of the other colour closes (the first red candle in a buy, or the first green candle in a sell), close the trade at the real open of the next candle. Then wait for the next signal.
  6. Size every trade so that a loss at the stop-loss costs 1% of the account. Only one trade is open at a time.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, USD/JPY, Gold, Silver, Nasdaq 100, S&P 500 and DAX
Charts
15-minute, 1-hour, 4-hour and daily candles
Dates
January 2014 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2014 to 2021 and again from 2022 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2022 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the Heikin Ashi colour change strategy be improved?

We tried three changes that Heikin Ashi traders often make, one at a time, on the same 32 tests. The first takes a trade only when the second signal candle has no wick against the trade. The second holds the trade longer: it closes after two candles of the other colour, not one. The third trades only in the direction of the Heikin Ashi candles on a higher chart, the way many traders check the daily chart before they trade on the 4-hour chart. If you pick the best change and judge it on the same years, it will almost always look good. So we picked the best change using 2014–2021 only, by the number of tests that made money, and by the middle test if that was a tie. Then we checked it on 2022–2025, the years we did not use to pick it.

Version Made money 2014–2021years used to pick the best version Made money 2022–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules: exit at the first candle of the other colour The rules under 'The rules we tested', with nothing added. 7 of 32middle test −98.2% 7 of 32middle test 0.0% 5 0
Only when the second signal candle has no wick against the trade Take the trade only when the second Heikin Ashi signal candle has no wick against the trade: a green candle with no lower wick, or a red candle with no upper wick (a wick is the thin line above or below the candle's body). Many traders read these candles as a sign of a strong move. If the second signal candle has such a wick, skip the signal. 7 of 32middle test −87.9% 8 of 32middle test −3.1% 4 2
Exit after two candles of the other colour Close the trade only after two Heikin Ashi candles of the other colour in a row, not after the first one. The trade closes at the real open of the next candle. These two candles are also the signal for a trade in the other direction, with its stop-loss at the real high (or low) of the two candles. This new trade opens one candle later, at the real open of the candle after that, but only if the candle in between also has the new colour. 6 of 32middle test −97.2% 9 of 32middle test 0.0% 1 0
With a higher-timeframe Heikin Ashi filterBest on 2014–2021 Only buy when the last finished Heikin Ashi candle on the next higher chart is green, and only sell short when it is red. The higher chart is the 1-hour chart for 15-minute trades, the 4-hour chart for 1-hour trades, the daily chart for 4-hour trades and the weekly chart for daily trades. A skipped signal does not open later. 7 of 32middle test −65.2% 8 of 32middle test −2.0% 5 2

Not clearly: none of the three changes made money in both periods in more tests than the standard rules. In 2014–2021, the years we used to pick the best change, the higher-timeframe filter and the no-wick rule each made money in 7 of 32 tests, the same as the standard rules. Because of this tie, we picked the filter by its middle test in 2014–2021 (half of the 32 did better, half did worse). It lost less: −65.2%, compared with −87.9% for the no-wick rule. In 2022–2025, the years we kept for the check, 8 tests made money with the filter, compared with 7, but one of those 8 (the Nasdaq 100 on 1-hour charts, +1.6%) was an account that had already lost more than 90%. With the filter, 5 tests made money in both periods, the same as with the standard rules, but 2 daily tests passed all four checks: GBP/USD and gold. From 2014 to 2025, after trading costs, the average trade did better with it (R is 1% of the account at the time of the trade): +0.013R on 4-hour charts, compared with −0.019R, and +0.036R on daily charts, compared with +0.007R. On 4-hour charts, 4 of the 8 markets made money with it from 2014 to 2025, compared with 2. But part of this comes from the years before mid-2018, when our index data is less certain: the Nasdaq 100 4-hour account with the filter was already up 39.6% at the end of June 2018, and at the end of 2025 it was up 71.5%. No change helped on 15-minute and 1-hour charts: in every version, at least 15 of these 16 backtests lost more than 90% of their starting balance before 2022, so they made few trades or none in 2022–2025, and the middle test of each version there is close to 0%. With the no-wick rule, 2 daily tests passed all four checks too (GBP/USD and gold), but only 4 tests made money in both periods. Waiting for two candles of the other colour did worst: only 1 test made money in both periods.

Passed all four checks with a higher-timeframe Heikin Ashi filter

  • GBP/USD, daily
  • Gold, daily

Questions

Questions traders ask

Does the Heikin Ashi colour change strategy work?

Mostly no. We ran 32 backtests from 2014 to 2025: 8 markets, each on 15-minute, 1-hour, 4-hour and daily charts. With trading costs, and with every trade at real prices (prices the market actually traded at, not Heikin Ashi prices), 5 of the 32 tests made money. All 5 were on 4-hour or daily charts. On daily charts, 3 of the 8 markets made money: gold, the Nasdaq 100 and GBP/USD. On 4-hour charts, USD/JPY (+229.3%) and the DAX (+177.9%) made the most, and the other 6 markets lost money. The index results on 4-hour charts are less certain before mid-2018 (see 'What we found'). On 15-minute and 1-hour charts, all 16 tests lost more than 90% of their starting balance, the 10 on currencies, gold and silver too. With the standard rules, no test passed all four of our checks: at least 100 trades, money made in both 2014–2021 and 2022–2025, a profit factor (the money won divided by the money lost) of at least 1.2 in 2022–2025, and, in 95% of 1,000 random orders of the trades, a drawdown (a fall from the highest balance) of no more than 30%.

What is the best timeframe for Heikin Ashi?

For the Heikin Ashi colour change strategy, the daily chart did best in our test, by the number of markets that made money after trading costs: 3 of 8. Trading costs took only 2.7% of the money each daily trade risked, on average. On 4-hour charts, only 2 of the 8 markets made money, but these 2 were the biggest results of all 32 tests: USD/JPY +229.3% and the DAX +177.9% (the index results on 4-hour charts are less certain before mid-2018; see 'What we found'). On 15-minute and 1-hour charts, the strategy lost money on all 8 markets, and every test lost more than 90% of its starting balance, the 10 on currencies, gold and silver too. On these charts, even before trading costs, the trades made almost nothing. The stop-loss, at the real low or high of the two signal candles, is close to the entry price, so a trade that risks 1% is large, and trading costs took 23.7% of the money each 15-minute trade risked, on average. So in this test, the colour change strategy did not work on 15-minute and 1-hour charts, the short charts that day traders often use.

Why do Heikin Ashi backtests look so good?

One reason can be that they open and close trades at Heikin Ashi prices. A Heikin Ashi open or close is an average, and often the market never traded at that price. When we re-ran every signal of our 32 tests at Heikin Ashi prices, before trading costs, 53.1% of the trades won and all 32 tests made money. At real prices, also before trading costs, 29.7% of the trades won and 17 of the 32 tests made money, and after trading costs only 5 made money. The Heikin Ashi entry price was better than the real one in 79% of the trades. If you backtest Heikin Ashi signals, make sure that your backtest opens and closes every trade at real prices.

Does a higher-timeframe filter help a Heikin Ashi strategy?

In our test, not clearly: with the filter, 5 tests made money in both 2014–2021 and 2022–2025, the same as without it. But 2 daily tests passed all four of our checks with it (GBP/USD and gold), compared with none without it. With the filter, the colour change strategy only buys when the last finished Heikin Ashi candle on the next higher chart is green (for example, the daily chart for 4-hour trades), and only sells short when it is red. On 4-hour and daily charts, it skipped more than half of the trades. In 2022–2025, the years we did not use to choose it, 8 of 32 tests made money with the filter (one of them on an account that had already lost more than 90%), compared with 7 without it. Over all of 2014–2025, which includes the years we used to choose it, 8 tests made money with it, compared with 5. On the Nasdaq 100 4-hour chart, much of the gain with the filter came before July 2018, when our index data has almost no price changes overnight. On 15-minute and 1-hour charts, it did not help: 15 of the 16 tests still lost more than 90% of their starting balance.

The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class HeikinAshiColourChange(Strategy):
    """Heikin Ashi colour change, as most traders trade it, plus three common changes.
    Heikin Ashi (HA) candles are worked out from the real candles:
      HA close = (open + high + low + close) / 4 of the real candle
      HA open  = (HA open + HA close) / 2 of the previous HA candle
      HA high  = the highest of the real high, the HA open and the HA close
      HA low   = the lowest of the real low, the HA open and the HA close
    An HA candle is bullish when its HA close is above its HA open, bearish when below.
    The signals read only HA candles that have closed. Every order fills at REAL prices:
    a trade opens at the real open of the next candle, the stop-loss is a real price
    level (the real low or high of the signal candles), and an exit fills at the real
    open of the candle after the exit signal. HA open and close are averages, not prices
    anyone traded at, so a backtest that fills at them looks far better than it is.
    Standard (all switches off):
      Buy at the next open when two bullish HA candles in a row follow a bearish one.
      Sell short at the next open when two bearish HA candles in a row follow a bullish one.
      Exit at the next open after the first HA candle of the opposite colour.
      Stop-loss: the lowest real low of the two signal candles for a buy, the highest
      real high for a sell. It does not move. Size: 1% of the account lost at the stop.
    Skipped candles: a candle that opens on a Friday at 17:00 New York time or later. The
    markets in this test are closed then, but some index data (the S&P 500 and the Nasdaq 100
    from 2014 to 2018, and a few DAX and silver Fridays) has a few minutes of prices after the
    close, which make a tiny extra candle. The strategy ignores it: no HA candle, no signal,
    no exit. On the higher chart, it ignores the daily or 4-hour candle that closes on a
    Saturday (UTC) for the same reason. On a market that trades at the weekend, remove both.
    The changes, one at a time:
      no_wick    = 1  only trade when the second signal candle has no wick against the
                      trade: no lower wick on a bullish candle, no upper wick on a bearish one
      exit_two   = 1  exit only after two HA candles of the opposite colour in a row. They
                      are also the signal for the opposite trade, which opens one candle
                      later, once the old trade has closed
      htf_filter = 1  only buy when the last closed HA candle on the next higher chart is
                      bullish (M15 -> H1, H1 -> H4, H4 -> daily, daily -> weekly), only sell
                      when it is bearish
    """
    params = {"no_wick": Param(type=int, default=0, min=0, max=1),
              "exit_two": Param(type=int, default=0, min=0, max=1),
              "htf_filter": Param(type=int, default=0, min=0, max=1)}
    lookback = 10
    def init(self, ctx):
        self.ha = []           # the last 3 candles used: (HA open, HA high, HA low, HA close, real high, real low)
        self.ny = ctx.clock("America/New_York")
        self.htf = None
        self.htf_ha = None     # the last closed HA candle on the higher chart
        self.htf_bar = -1
        if ctx.params.htf_filter == 1:
            higher = {"M1": "M15", "M5": "M30", "M15": "H1", "M30": "H4", "H1": "H4",
                      "H4": "D1", "D1": "W1"}[ctx.timeframe]
            self.htf = ctx.tf(higher)
        self.reverse_to = None     # exit_two: the opposite trade, waiting for the old one to close
        self.reverse_stop = None
    @staticmethod
    def heikin_ashi(o, h, l, c, prev):
        ha_close = (o + h + l + c) / 4.0
        ha_open = (o + c) / 2.0 if prev is None else (prev[0] + prev[3]) / 2.0
        return (ha_open, max(h, ha_open, ha_close), min(l, ha_open, ha_close), ha_close, h, l)
    @staticmethod
    def colour(candle):
        return 1 if candle[3] > candle[0] else -1 if candle[3] < candle[0] else 0
    def on_bar(self, ctx):
        # The higher chart's last closed candle, skipping a tiny Friday candle (it closes on a Saturday).
        if self.htf is not None and self.htf.bar_index >= 0 and self.htf.bar_index != self.htf_bar:
            self.htf_bar = self.htf.bar_index
            if (self.htf.bar_time // 86_400_000 + 3) % 7 != 5:
                self.htf_ha = self.heikin_ashi(self.htf.open[0], self.htf.high[0], self.htf.low[0],
                                               self.htf.close[0], self.htf_ha)
        # A tiny candle after the Friday close (see above): ignore it.
        if self.ny.weekday == 4 and self.ny.hour >= 17:
            return
        prev = self.ha[-1] if self.ha else None
        self.ha.append(self.heikin_ashi(ctx.open[0], ctx.high[0], ctx.low[0], ctx.close[0], prev))
        del self.ha[:-3]
        if len(self.ha) < 3:
            return
        c2, c1, c0 = (self.colour(x) for x in self.ha)
        # The real high and low of the two newest candles: the stop-loss of a new trade.
        high2 = max(self.ha[-1][4], self.ha[-2][4])
        low2 = min(self.ha[-1][5], self.ha[-2][5])
        pos = ctx.position
        if pos is not None:
            against = -1 if pos.is_long else 1
            if c0 == against and (ctx.params.exit_two == 0 or c1 == against):
                ctx.close_position()
                if ctx.params.exit_two == 1:
                    self.reverse_to = "short" if pos.is_long else "long"
                    self.reverse_stop = high2 if pos.is_long else low2
            return
        # Two candles of the new colour after one of the old colour. The stop-loss is the
        # real low (or high) of these two candles.
        go_long = c2 == -1 and c1 == 1 and c0 == 1
        go_short = c2 == 1 and c1 == -1 and c0 == -1
        long_stop, short_stop = low2, high2
        # exit_two: the reversal waits one candle for the old trade to close.
        # Drop it if the colour turned back.
        pending, stop_then = self.reverse_to, self.reverse_stop
        self.reverse_to = self.reverse_stop = None
        if pending == "long" and c0 == 1:
            go_long, long_stop = True, stop_then
        if pending == "short" and c0 == -1:
            go_short, short_stop = True, stop_then
        entry = ctx.close[0]
        ha_open, ha_high, ha_low = self.ha[-1][0], self.ha[-1][1], self.ha[-1][2]
        htf_colour = self.colour(self.htf_ha) if self.htf_ha is not None else 0
        if ctx.gate("ha_two_bullish_after_bearish", go_long):
            if not ctx.gate("no_lower_wick", ctx.params.no_wick == 0 or ha_low == ha_open):
                return
            if not ctx.gate("higher_chart_bullish", self.htf is None or htf_colour == 1):
                return
            if long_stop < entry:
                ctx.buy(size=ctx.size_by_risk_pct(0.01, stop=long_stop, entry=entry), sl=long_stop,
                        tag="ha_long")
        elif ctx.gate("ha_two_bearish_after_bullish", go_short):
            if not ctx.gate("no_upper_wick", ctx.params.no_wick == 0 or ha_high == ha_open):
                return
            if not ctx.gate("higher_chart_bearish", self.htf is None or htf_colour == -1):
                return
            if short_stop > entry:
                ctx.sell(size=ctx.size_by_risk_pct(0.01, stop=short_stop, entry=entry), sl=short_stop,
                         tag="ha_short")

Your turn

Test the Heikin Ashi colour change strategy yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest a Heikin Ashi colour change strategy on gold, daily chart, from 2014 to 2025: buy when two green Heikin Ashi candles in a row follow a red one and the last finished weekly Heikin Ashi candle is green, sell short in the opposite case, exit after the first candle of the other colour, stop-loss at the real low or high of the two signal candles, real prices for every fill, 1% risk per trade.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 19 October 2026.