Heiken Ashi Naïve is a MetaTrader expert advisor based on Heiken Ashi charting system through the platform's standard indicator by the same name. The employed trading system is naive in a way that it interprets only two latest Heiken Ashi candles and does not apply any complex pattern analysis. The only trick is that the expert advisor trades against the supposed trend direction, confirmed by current Heiken Ashi setup. Its biggest advantage is that it has no input parameters to optimize and curve-fit to the past data. Optional ATR-based position sizing is available for improved money management. There are two versions of the EA: a plain one and one with Z-Score optimization applied. The expert advisor (with and without Z-Score optimization) is available for both MT4 and MT5 versions of the platform.
Heiken Ashi (or Heikin Ashi, from Japanese 平均足) is an alternative technique of representing the usual candlestick charts for the purpose of trading. Unlike with traditional Japanese candles, it is impossible to read the actual price levels (Open, High, Low and Close) on Heiken Ashi chart, but it is easier to spot trend developments and reversals. Rising Heiken Ashi candles are usually plotted as white ones, and the falling — as red ones. Similarly to the standard candles, Heiken Ashi show wicks. Neither direction of a candle, nor the length of its wicks point to actual price levels, but rather should be considered in relation to other Heiken Ashi candles in the close proximity.
The switch of colors means a change of trend: red to white — a bearish trend reversal, white to red — a bullish trend reversal. Increasing candle body length signals strengthening of trend. Decreasing — signals weakening. Lower wicks on white candles and upper wicks on red candles signal volatility and trend instability. Lack of such wicks indicates a definite and clear trend.
The following rules are used to calculate Heiken Ashi candle levels:
The chart that you see below demonstrates the Heiken Ashi candle technique, showing both trending and ranging periods. The initial uptrend (white) becomes weak with Heiken Ashi doji and turns red for four candles. Only one candle (second) in this downtrend qualifies for a strong bearish trend according to Heiken Ashi rules outlined above. The renewed bullish trend shows a period of weakness (short-bodied candles with downside wicks) but then returns to its strength. A small red correction goes rather deep and is signaled as such by the long-bodied candles without upper wicks. Without a clear reversal signal, a new upward trend ensues. It was followed by a plateau with a chaos of red/white colors, which ended in a long downward trend. A small correction consisting of five white with one red candle in a middle did not stop the whole trend going south till the end of the chart.
Naturally, such an indicator looks rather promising to traders who wish to trade on trends and their reversals.
Heiken Ashi Naïve expert advisor uses a rather simple, yet not very obvious method to trade with Heiken Ashi candles.
The following entry signals are used:
If there exists an open position in an opposite direction when a signal arrives, the position is closed. If the existing position is in the same direction as the signal, the latter is ignored.
The following exit signals are used to close trades before a new entry signal arrives:
As you can see, the expert advisor uses the inverted logic in its trading strategy. It goes long when the Heiken Ashi system points at a rather strong bearish trend, and it goes short when it is a bullish rally according to Heiken Ashi. The trick here is that it tries to catch reversals as early as possible.
The chart screenshot from the strategy backtest on EUR/JPY is shown below. There are six completed trades:
Heiken Ashi Naïve expert advisor uses the same advanced position sizing system as the Ichimoku Chikou Cross expert advisor. It is capable of both fixed position size and ATR-based fixed fractional position size.
The second version of this expert advisor has Z-Score optimization implemented in its algorithm. Z-Score optimization is based on the intrinsic parameter of some Forex strategies. Basically, Z-Score value tells us if there is any correlation between the trade outcomes of the given strategy. Large positive Z-score (like the one of Heiken Ashi Naïve on EUR/JPY @ D1) means that the winning trade is likely to be followed by a losing one, and that the losing trade will probably be followed by a winning one. Large negative Z-score would mean that winning trades are often followed by more winning trades, while losing trades frequently follow the same losing trades. Obviously, such metric can be used to optimize a trading strategy or an expert advisor.
Heiken Ashi Naïve with Z-score optimization stops trading following a profitable trade. It then switches to a virtual trading mode, where it calculates the trades, but does not actually send any orders to MetaTrader sever. Once a losing virtual trade is encountered, the EA switches back to real trading mode and continues normal operation. This expert advisor is also capable of saving and loading all the virtual trading data from file, preventing Z-score optimization malfunction due to software or hardware failures.
The backtest of the Heiken Ashi Naïve expert advisor was performed on the period from 1 January, 2001 through 6 December, 2013 (almost 13 years) on the EUR/JPY D1 chart.
When fixed position volume of 0.1 standard lot has been used, the resulting net profit was $11,112 on $10,000 starting account balance with the maximum relative drawdown of 15.8%.
With ATR-based position sizing enabled (ATR period = 20; ATR multiplier = 1; 2% risk tolerance), the resulting net profit increased to $29,903 on the same $10,000 starting account balance, while the maximum relative drawdown increased to 39%.
Z-Score optimized version of Heiken Ashi Naïve expert advisor was backtested on the same data as the original version. The performance resulted in $8,119 profit and 9.11% relative drawdown for a fixed position size (0.1 standard lot). When using ATR-based position sizing, the EA has shown $15,002 with 20.9% drawdown.
As you can see, there is little point in using a Z-Score optimized version of this expert advisor unless you really need to obtain a lower drawdown value. Z-Score version makes only 109 trades compared to 349 trades of the original version. Another advantage of Z-Score version is the expected payoff of $74.49 vs. $31.84 per trade and the doubled Sharp ratio (0.31 vs. 0.14).
What is the average win/loss size generated by this EA?
Its backtest on EUR/JPY @ D1 showed an average losing trade of 287 pips and an average winning trade of 183 pips. The version with Z-Score optimization has shown 241 pips average loss and 156 pips for average profitable position.
How often does this EA trade?
On daily EUR/JPY chart (default setting), this EA will trade about 2 times a month on average. Z-Score version of Heiken Ashi Naïve will trade about 8 times a year.
What is the difference between the versions for MT4 and for MT5?
MT5 version will interfere with positions of other expert advisors on the same currency pair. MT4 will use Magic number to avoid that.
Did it show profitable results on any other currency pairs?
Some other currency pairs show insignificant profit, which are spoiled by big drawdowns. It looks like only EUR/JPY has some trading characteristics that are captured by this expert advisor.
Did you optimize the input parameters of this expert advisor?
There are no inputs to optimize unless you consider currency pair and timeframe as inputs.
This EA is ECN-safe. You can freely use this expert advisor with ECN (market execution) brokers as it either does not apply any stop-loss and take-profit levels in its trading orders or sends only pending orders.
Warning! Before you ask basic questions regarding installation of the expert advisors, please, read this MT4 Expert Advisors Tutorial to get the elementary knowledge on handling them.
Do you have your own trading results or any other remarks regarding this expert advisor? Discuss Heiken Ashi Naïve with other traders and MQL programmers on the experts forums.