Apologies that I didn't post an update on the EA development yesterday - the weather here in Melbourne was too good to be indoors yesterday.
As indicated yesterday, I finished writing and testing the 1st version of the Daily HA / Smoothed Line EA. This version includes the following functionality:
1. Places a buy order on open if for the previous day the HA Close > Smoothed Line High (SLH = 5 day SMA of HA Highs)
2. Closes a buy order on open if one of the following occurs the previous day:
2a. The HA Close < Smoothed Line Low (SLL = 5 day SMA of HA Lows)
2b. The colour of the HA bar changes from green to red
3. Closes a buy order if the stoploss placed at the lowest low of the previous 10 bars is hit
And vice versa for sell orders.
The EA was bug-tested on the NU for a backtest period of 18 months from 1/1/2017 - 1/7/2018 (my standard backtest period). I tested the EA execution on the 1st 20 actions for the backtest (10 buys or sells and 10 order closures). The bug-test chart is shown below with a HA overlay on the standard bars (light blue bars for HA upclose, brown for HA downclose, to make it easier to see the EA action icons, which are numbered for easy reference to the tables below):
The 1st 20 actions were checked for the required conditions, and all 20 were determined to be correct - see table below:
So based on this check I believe the EA operates correctly.
The results for the NU backtest period are shown below along with the full chart:
So this initial backtest looks quite promising. So as per my standard procedure I do a backapp on an out of sample period, which for me is a standard 18 month period (same as backtest period) but from 1/1/2015 to 1/7/2016. The results for the NU are shown below:
So this result doesn't look so good, and in fact if you add the 2 periods together it basically comes out breakeven over a 3 year period. Less promising than just the original backtest results indicate.
I then tested 2 other markets Rick mentioned - the UJ and EC - for both backtest and backapp sample periods. The results are shown below:
UJ backtest period:
UJ backapp period (without chart):
EC backtest period:
EC backapp period:
So we can see from the above that the basic rules as described on their own are not sufficient to generate consistently profitable results. To improve the results, additional filter(s) are needed to exclude unprofitable periods, for example a weekly filter as per Rick's suggestion. Other options that I like to consider, based on what I have seen with my EA development experience so far, is to include alternative exit conditions which give an opportunity to optimise based on a matrix of values. The best options I have found is to use different ratios of a fixed takeprofit to stoploss distance - primarily because each market behaves differently (different levels of volatility, tendency to trend, etc).
I repeated the same with an EA based on standar bars rather than HA bars (as per the spreadsheet I posted last week), and the results were similar but comparing the 2 (HA vs std bars) the HA bars overall I would say are better - so imo worth exploring with more work on the use of HA bars.
Going off on a tangent, decided to try another approach using HA bars - discarding the smoothed lines I decided to try using the classic strategy for HA bars, which is for a buy to buy if a previous bar changes from red to green AND a subsequent bar closes above the high of the bar that changed colour (and vice versa for sells), combined with fixed takeprofit/stoploss options. I got some pretty good results from that and will share in my next post (since this one is already very long).