I have never been a huge fan of Heiken Ashi and I still have not recorded any trades on my live account based on this charting technique. But, from what I had known about Heiken Ashi, it looked like an interesting system that could be used in price action type of trading. And since I am not a big believer in trading systems with lots of optimizable parameters, I decided to use HA as a basis of my next MetaTrader expert advisor.
- 1 Generating No-Input Strategies
- 2.1 Results
- 3 Reverting a Strategy
- 4 Heiken Ashi NaÃ¯ve
- 5 Further Research
Although Heiken Ashi indicator has no input parameters in MetaTrader, there are still some points left for traders to control:
As a developer of the expert advisor, I can leave the third question for the end users, implementing some usual options: fixed position sizing and fixed fractional position sizing with enough parameters to
After watching many charts and reading some articles on Heiken Ashi, I have decided to build an expert advisor based only on few latest candles without big pattern analysis. The first thing I have done then is creating the simplest possible Heiken Ashi EA, which would buy on a white (bullish) candle and sell on a red (bearish) candle. Testing it on EUR/USD @ D1 showed a rather big loss, so I proceeded with creating more strategies (EAs).
Using such basic properties of candles as bearish/bullish, increasing/decreasing body size, presence of wicks (shadows) and observing them on two latest bars, I generated a total of 28 different strategies.
Now they had to be backtested. I have decided to use only D1 (daily) timeframe for backtesting. Any lower timeframes significantly increased the number of transactions and thus the spread cost of trading. Meanwhile, W1 (weekly) timeframe is too
For currency pairs, I decided to choose all majors and some
You may now download all 28 expert advisors and the results of their backtests:
As you can see, the results are not very impressive. The biggest profit ($4,031) is on USD/CHF with 3rd trading strategy (buy on bullish HA candle, which has longer body than previous and previous is also bullish, sell on inverted conditions). But, after looking at its balance curve, you would hardly decide to try using the EA on real account. Big drawdowns hint on the possibility of the result being just a quirk of luck:
Reverting a Strategy
Now, there is an important trick to these backtesting results. All of the strategies used in the tested EAs are reversible, which means that we can interpret the negative profit results as a good sign — after we revert the strategy (simply by switching bearish and bullish signals places), the EA will probably turn to profit. Of course, you still have to account for spread. The size of total net loss divided by the total number of trades should be at least twice higher than the average spread paid for those trades.
For example, the 28th strategy on EUR/JPY currency pair resulted in $10,073 loss with 242 trades. The strategy is quite complex (compared to the 1st one, for example): buy if latest HA candle is bullish, its body is longer than previous candle’s body, previous candle is bullish too, and latest candle has no lower wick; sell on inverted conditions; additionally, close long trades on the same conditions as sell entry but without waiting for longer body condition; short closing signal uses the same logic but with inverted conditions.
The resulting $41.62 loss per trade is much higher than the average spread value of one trade (2 Ã 50 fractional pips, which is about $20 per 0.1 lot trade). Apparently, reversing the strategy should work and result in some profit. And indeed, $10,073 loss turns into $11,416 profit with a steady balance curve:
It is a nice profit for a fixed position size of 0.1 standard lot. So, I have chosen this variant as the base for the final version of my Heiken Ashi expert advisor.
Heiken Ashi NaÃ¯ve
Heiken Ashi NaÃ¯ve is a reversed version of the 28th variant of the initial Heiken Ashi EA with the following advanced features implemented:
Full information and download links for this expert advisor are available on a separate page:
Of course, there is a lot of space for improvement here. Although this EA does not need any optimization, further experimenting with different Heiken Ashi strategies is definitely possible. It is possible to extend the condition assessment to more than two latest candles. Other properties of HA candles can be measured.
Additionally, improvement could probably be attained with some other currency pairs (
Although the system’s balance curve looks good, it contains two significant drawdowns. These drawdowns could possibly be narrowed by applying some additional signal filtering or a specific position sizing technique.
If you have any questions or some interesting thoughts regarding the Heiken Ashi NaÃ¯ve, please feel free to post them using the form below.