Discussing the article: "MQL5 Wizard Techniques you should know (Part 25): Multi-Timeframe Testing and Trading"

 

Check out the new article: MQL5 Wizard Techniques you should know (Part 25): Multi-Timeframe Testing and Trading.

Strategies that are based on multiple time frames cannot be tested in wizard assembled Expert Advisors by default because of the MQL5 code architecture used in the assembly classes. We explore a possible work around this limitation for strategies that look to use multiple time frames in a case study with the quadratic moving average.

In our last article we looked at Pythagorean Means which are a group of moving averages of which some are quite novel and not common enough despite their potential in benefiting some traders as we hinted in the test reports. These Pythagorean Means were represented in a semicircle diagram that summarized what each mean value was when presented with two unequal values that added up to the diameter of the semicircle. Among the chord values in the semicircle that was not touched on in the article was the value indicated as Q that represented the quadratic mean of the two values a and b.

The quadratic mean (QM) is also commonly referred to as the root-mean-square and as a mean it tends to be weighted more towards the larger values in the set whose mean is sought, which is unlike the geometric and harmonic mean’s we looked at in the previous article. It is also like the geometric mean only returns positive values, so the sampled set whose mean is sought needs to have only positive values. The title of this article though is implementing multi-timeframe strategies in wizard assembled Expert Advisors, so QM is simply going to be the tool that we use to show how multiple timeframes can be tested on in a wizard-built Expert.

So why is testing on multiple timeframes tricky with wizard-built Experts? Well in my opinion this is because the customization of this should happen for each added signal in the wizard assembly space and this is often missed. The customization of the Symbol-names and Time-frames for a wizard assembled Expert Advisor can be done during the wizard signal selection steps, but often most people assume once you pick a signal then you get to pick the symbol and period, but this should not be the case with wizard assembly. In this prior article, I showed various ways of accommodating multiple symbol trading in wizard assembled Experts by modifying assembled source code. One obvious and primary approach I did not share, performing multiple attachments of signals, where each signal attachment would be for a specific symbol. These multiple attachments happen despite attaching the very same signal. The signal customization in assigning the symbol should be done in these steps indicated below:

n1


n2

Where

  • n is the number of values in the set
  • x are the values in the set at their respective index

Author: Stephen Njuki