Brute-Forcing Heiken Ashi EA Ideas

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.

Contents

  • 1 Generating No-Input Strategies
  • 2 Backtesting

    • 2.1 Results
  • 3 Reverting a Strategy
  • 4 Heiken Ashi Naïve
  • 5 Further Research

Generating No-Input Strategies
Although Heiken Ashi indicator has no input parameters in MetaTrader, there are still some points left for traders to control:

  • How to interpret Heiken Ashi candles?
  • What currency pair and timeframe combination to use?
  • Which position sizing method to use?
  • 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 fine-tune money management as precisely as needed. The first two questions have to be, at least partially, solved at the development stage.
    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.
    Backtesting
    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 long-term and cannot be tested well due to the low number of trades even on big testing periods.
    For currency pairs, I decided to choose all majors and some low-spread crosses: AUD/USD, EUR/USD, GBP/USD, USD/JPY, USD/CAD, USD/CHF, NZD/USD, AUD/NZD, GBP/JPY, EUR/GBP and EUR/JPY. Each of the 28 expert advisors had to be tested on every currency pair. My assistant has helped me to generate the backtesting reports for all 308 combinations on a period from January 1, 2001 to November 3, 2013. Fixed position size of 0.1 standard lot had been used during the whole testing process.
    You may now download all 28 expert advisors and the results of their backtests:

  • 28 HeikenAshi expert advisors implementing basic trading strategies
  • Reports with results of 308 backtests of those 28 EAs on period between 2001-01-01 and 2013-11-03
  • Results comparison table (in OpenDocument Spreadsheet format)
  • Results
    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:

  • Dual position sizing — either fixed or fixed fractional (ATR-based).
  • Work with and without
    Z-score optimization.
  • Available for MetaTrader 4 and for MetaTrader 5.
  • Full information and download links for this expert advisor are available on a separate page:

  • Heiken Ashi Naïve
  • Further Research
    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 (low-spread exotics?) or with ECN brokers, which would allow substituting spread for a fixed commission.
    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.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    nine + one =