Morning folks Apologies that I didn't post an update on the EA...

  1. 8,420 Posts.
    lightbulb Created with Sketch. 59
    Morning folks

    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):

    NU Daily backtest check.PNG

    The 1st 20 actions were checked for the required conditions, and all 20 were determined to be correct - see table below:

    NU Daily backtest checklist.PNG

    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:

    NU Daily backtest results.PNG
    NU Daily backtest graph.PNG

    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:

    NU Daily backapp results.PNG
    NU Daily backapp graph.PNG

    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 Daily backtest results.PNG UJ Daily backtest graph.PNG
    UJ backapp period (without chart):

    UJ Daily backapp results.PNG UJ Daily backapp graph.PNG
    EC backtest period:

    EC Daily backtest results.PNG EC Daily backtest graph.PNG
    EC backapp period:

    EC Daily backapp results.PNG EC Daily backapp graph.PNG
    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).

    Cheers, Sharks
 
arrow-down-2 Created with Sketch. arrow-down-2 Created with Sketch.