robot-59

Backtesting Results January 2017: SigmaR MT4 Hurst Cycles Expert Advisor

Time for some figures!

Further to my previous post briefly explaining the new development of an algorithmic approach to trading FLDs, as per JM Hurst’s cycle course, I thought I would share some results of the beta testing.

Preface

Within MT4 and MT5 there is a ‘strategy tester’ function that is extremely useful in backtesting a robot against data quickly. There are many articles and videos on this method so I will not go into it fully but suffice to say one must back and forward test a strategy to get a good idea of the optimised parameters for a particular market. Those that know me will appreciate I enjoy trading the DAX index for its volatility and low spreads, essential for an algorithmic approach such as SigmaR.

Variables

SigmaR has reached beta 1.4 and the following parameters are available to users. Each has a specific function to minimise risk and maximise profit. In conjunction they create a powerful system. Interactions with the FLD are both elegant and complicated. There are a multitude of possible variables to build into a system such as this over the development time. Below are parameters I have found to be most beneficial thus far.

  • Schedule
  • [EAStart] This is the time of day when the EA is permitted to trade. As I am using the DAX and only want to trade at the lowest possible spread I set it to start at 8.00.
  • [EAFinish] Time of day when the EA stops trading. At this point all market and pending orders are closed whether in profit or not. For the DAX I have this at 16.30.
  • Money Management:
  • [Risk] This parameter specifies the percentage of free margin to risk on each trade. If this parameter is turned off ([UseMM] set to false) the default [LotSize] will be used. I always use the money management as the robot will scale up and calculate quickly the optimum risk profile I selected.
  • Future Line of Demarcation
  • [FLD_Shift] This will be familiar to anyone trading Hurst cycles as the horizontal shift by half the wavelength of the trading cycle. Any FLD can be used and although the EA doesn’t perform any kind of spectrascopic extraction (yet!) of the waves one could possibly use Sentient trader to get the latest settings. I am loosely using David Hickson’s intraday nominal model while running a vast optimisation test on a range of [FLD_Shift] settings. The backtest results below show the actual settings used after backward and forward testing in January.
  • [HighLowLookBack] This parameter tells the EA how many bars to look back to detect the lowest low (for a long trade) or the highest high (for a short trade). This is then fed into the calculation for the T2 targets.
  • Trade Settings
  • [MinimumProfit] This parameter is one aspect that keeps you out of grinding situations and choppy sideways movements. The system will not take any trades that it calculates have a minimum profit below the setting.
  • Volume Settings
  • [VolumeLookBack] This parameter is an essential component of the system and will provide the robot with an average volume profile across a specified number of bars. I have found this to be extremely beneficial in increasing profitability. Depending on the risk profile it increases profit by around 20-60%. Setting this and the threshold below to zero turns off any kind of volume filter.
  • [VolumeTradeThreshold] The level above which the EA will enter trades. Each market will have a different setting. On the DAX a sweetspot threshold for any period of lookback is between 28-35 according to my testing.
  • Trailing Stop Settings
  • [TrailStartPercentage] This parameter sets a percentage of profit above which the [TrailingStop] will kick in. I had originally tested with a points based setting but found a percentage approach was more profitable. The trailing stop approach is essential in a robot of this kind and I would advise keeping it on at all times.
  • [TrailingStop] This is the number of pips below the bid price (long trade) or above the ask price (short trade) that the robot will trail the stop.
  • Timer Settings
  • [Timer] In my experiments with creating robots on PRT I found a timer to be somewhat useful in mopping up trades that were meadering along without hitting a stop or takeprofit. Implemented in MT4 gives the same increase in profit, although it is a small benefit.
Nominal 15 Minute FLD Results, Risk 2-20%, Jan 3rd to 27th 2017, Starting Deposit £1000

Note: Spread on the DAX via my broker is 1pt, quoted to 1 decimal place (10 pips). Most brokers offer around this level of spread on the DAX. The instrument must have a low spread to be profitable intraday (< 20 pips ideally). I imagine some of the major forex pairs with their spreads below 10 pips may well be extremely profitable!

Note 2: A profit factor above 2 is extremely good. This means that for every 1 losing trade there are 2 winning trades. A profit factor above 1  is still good in some circumstances. Above 3 is a spectacular result. Note below the risk and drawdown rising in unison, however.

Parameters:[Risk]=2-20 (shown as ‘pass 1-18’ below), [FLD_Shift]=9, [HighLowLookBack]=12, [MinimumProfit]=11, [VolumeLookBack]=58, [VolumeTradeThreshold]=32, [TrailStartPercentage]=53,[TrailingStop]=19, [Timer]=185.

Pass Profit Total trades Profit factor Expected Payoff Drawdown £ Drawdown %
18 101163.14 100 6.20 1011.63 14000.00 48.80
19 98278.41 98 5.90 1002.84 14000.00 50.93
17 75132.10 102 5.77 736.59 14000.00 55.98
16 58076.50 102 5.30 569.38 10906.00 54.33
15 46489.60 102 4.93 455.78 8274.00 51.61
14 35669.00 102 4.52 349.70 6020.00 49.82
13 29572.20 102 4.25 289.92 4704.00 46.23
12 22400.80 102 3.94 219.62 3346.00 45.05
11 17110.00 102 3.71 167.75 2408.00 42.32
10 14183.90 102 3.52 139.06 1867.60 38.91
9 10657.60 102 3.31 104.49 1498.20 36.14
8 8432.30 102 3.14 82.67 1256.60 32.08
7 6306.60 102 2.96 61.83 979.80 30.41
6 4766.00 102 2.86 46.73 754.00 25.66
5 3475.30 102 2.71 34.07 575.40 23.24
4 2516.30 102 2.61 24.67 427.50 20.66
3 1778.20 102 2.53 17.43 321.20 16.66
2 1291.10 102 2.64 12.66 220.50 12.80
1 728.80 102 2.48 7.15 122.30 9.85
Nominal 60 Minute FLD Results, Risk 2-20%, Jan 3rd to 27th 2017, Starting Deposit £1000

Parameters:[Risk]=2-20 (shown as ‘pass 1-18’ below), [FLD_Shift]=36, [HighLowLookBack]=50, [MinimumProfit]=12, [VolumeLookBack]=69, [VolumeTradeThreshold]=34, [TrailStartPercentage]=55,[TrailingStop]=30, [Timer]=278.

Pass Profit Total trades Profit factor Expected Payoff Drawdown £ Drawdown %
19 137177.40 128 1.46 1071.70 69700.00 36.67
18 104844.40 128 1.38 819.10 69580.30 40.04
17 78576.60 128 1.33 613.88 67283.80 46.04
16 46171.70 128 1.24 360.72 57526.40 55.01
15 34075.70 128 1.24 266.22 45759.90 56.71
14 27807.40 128 1.25 217.25 33877.00 54.18
13 21838.90 128 1.27 170.62 24143.00 51.55
12 17600.40 128 1.29 137.50 17644.50 48.86
11 14076.00 128 1.32 109.97 12733.00 45.98
10 10931.20 128 1.34 85.40 8976.40 43.14
9 8732.40 128 1.37 68.22 6426.90 39.97
8 6669.90 128 1.39 52.11 4351.00 36.39
7 5241.40 128 1.42 40.95 3091.50 33.30
6 4011.40 128 1.46 31.34 2074.30 29.43
5 3021.60 128 1.50 23.61 1398.50 25.94
4 2096.80 128 1.52 16.38 916.80 22.96
3 1469.60 128 1.56 11.48 588.10 19.32
2 1021.90 128 1.63 7.98 344.70 14.61
1 640.30 128 1.70 5.00 186.10 10.21

Variables that failed to increase profitability:

  • Smoothing of the FLD. Suprisingly smoothing the FLD did not increase profit, infact it decreased it, much to my suprise. It was ditched.
  • Risk reduction stop. I programmed the stop to move up by the amount of pips in profit that the trade had achieved. This also reduced profit as price during the trading cycle comes back down to test levels. Close inspection of trades in the visual mode of the backtester revealed stops being triggered for a small loss that would then have gone on to make the trailing stop or takeprofit target.

I hope that gives some insight into the development. I imagine it will be ready to go across multiple instruments at the end of the 1st quarter.

I have been running it live on a ‘real money’ account for the last three weeks. It is very nice indeed to let it do its thing I must say!

17 comments

  • Dimitri Kasselidis

    Hello Dave,

    I am already trading on MT4. Could one actually try SigmaR yet ? If so, are there any instructions on how to install it ?

    Thank you
    Dimitri

    • Hi Dimitri,

      Its far from the finished product yet, probably end of the 1st Q. Not sure if I will put it on the market. Will probably give it to a few Hurst traders. Will update in due course

      Dave

  • Dale Todd

    Hi David,
    I appreciate your posts in the Hurst Cycles Forum, and find your trading robot very interesting, although much beyond my capabilities. I am curious about your parameters for Risk on your inputs – so when you increase the Risk, are you only increasing the margin at risk by increasing lot size, or are you also increasing the size of your stop? What is your initial stop, i.e if your trade does not make it into a minimum profit for the trailing stop to kick-in? Thanks!

    • Hi Dale,

      The risk % is simply a calculation of the % of free margin on the account to use for any new trade. The stops all stay the same. For example if teo trades are opened at exactly the same time and your risk is set to 10% of free margin each trade will use 5% of that free margin and the lotsize will be adjusted automatically to reflect this.

      The trailing stop can kick in from 1 to 99% of profit. Optimising it is key to making profits. When it kicks in one can also set the number of pips behind the pruce to trail. A combination of these two variables is necessary to find the sweetspot for a particular FLD.

      Dave

      • Dale Todd

        Dave,
        So once your risk is set to 10%, the position will automatically be stopped out when that trade or combination of trades loses 10%? Obviously, if the trailing stop were to kick in, that would not be an issue, it would just be a matter of how much profit you made.

        • No Dale. 10% risk would mean that if, for example, you had a £1000 account and no trades were open, there would be £100 available to the system for any new trade. It then automatically decides the lotsize etc..

          Hope that clears it up

          Dave

          • Dale Todd

            Thanks Dave! I will keep an eye on this site for more updates.

  • Dale Todd

    Hi Dave,
    I have another question. How does your robot guard against instances where the target generated by Hurst Cycles Indicators disappears? I have been running into the situation where a target is generated after price moves beyond the FLD, comes back to the FLD, but instead of finding support or resistance there, goes back through the FLD and generates a new target in the opposite direction. This has been occurring quite frequently. Thanks for your input!

    • Thats the nature of the underlying trend. If you have done your reading correctly you will realise that a missed target tells you the underlying trend is stronger in the other direction. The robot mitigates against this by using a trailing stop which kicks in after a certain amount of the move. It also uses volume and a minimum target to avoid choppy action.

      • Dale Todd

        So the robot has a threshold volume where if it is below that volume it won’t initiate the trade? And the minimum target – is that calculated as a percentage of the average daily range, or some other metric?

        • Correct on the first point. Minimum target is calculated from the lowest or highest recent high (according to the lookback parameter) through the median price crossing o fthe fld to the target.

          • Arjan

            Hi David
            Fascinating stuff you’re doing with this EA. One question though, you seem to be talking about a fixed minimum target (in the article) as well as some sort of dynamic one (in this reply). What’s the difference exactly and which one do you prefer? Don’t know if I understand your explanation of the “dynamic:” target correctly, because the median price cross of the FLD happens after the price cross itself., giving you your minimum target info after entry, not before. What am I misinterpreting?
            Any way: impressive job!
            Arjan

          • Hi Arjan,

            Thanks very much, its been an interesting few months working on this bot! Now to your questions…

            The fixed minimum target is specified by the user in the EA parameters. The bot measure the distance from the lowest (highest) point to the FLD to calculate a target when the FLD is touched by the criteria I have set (between the bid and ask spread in my case). If this distance is below the minimum the trade is not taken. Quite simple really and it is one of the basic aspects to keep you out of crappy sideways action.

            The ‘dynamic’ target is a bit more nuanced and works in conjunction with the other parameters. This measures the distance between the highest and lowest levels as defined by the lookback parameter. It then divides that distance by what I call the ‘span divider’, which is also within the EA parameters for the user to set. Usually this is set to 2 or above. I have mine set to 2.3 for the DAX. If this ‘dynamic’ minimum target is less than the fixed minimum target the trade will be taken. These settings provide a quick measure of volatility, put simply. It is dynamic because it is constantly changing to reflect the highest and lowest levels as defined by the lookback parameter. You can imagine it as an envelope around the range of price, if that enevelope is balanced in the correct way the trade is considered valid.

            Dave

  • Bob Wo

    Hi Dave,

    are the February trades looking better than the January results?

    Also, will you be releasing a beta code to test soon?

    Great work!
    Bob

    • Hi Bob,

      I have been tinkering with it for the last few weeks and its now looking pretty good! Its in a live test as we speak, the results of which will be ready by the end of March I think. No plans to release yet, its still only DAX focused. Possibly summertime, not sure.

      Dave

  • Arjan

    Hi David.
    Just wondering what the current status of the EA development and performance are. It’s been a while since your last update, have the months after that show significant change in performance? PM me if you prefer. Fascinated by any trading using the FLD, but personally currently more focused on the daily (the formal FLD trading strategy). Still interested to put more time and energy in lower timeframe automated FLD trading in the near future when time permits.

    • Hi Arjan, alas the EA is on the backburner because the backtesting facility in MT4 is fatally flawed and was giving erroneous results. Back to trading intraday manually (which is more fun anyway!). Might have another crack with MT5 in a few months, we’ll see.

Leave a Reply

Your email address will not be published.