Discussing the article: "MQL5 Wizard Techniques you should know (Part 26): Moving Averages and the Hurst Exponent"

 

Check out the new article: MQL5 Wizard Techniques you should know (Part 26): Moving Averages and the Hurst Exponent.

The Hurst Exponent is a measure of how much a time series auto-correlates over the long term. It is understood to be capturing the long-term properties of a time series and therefore carries some weight in time series analysis even outside of economic/ financial time series. We however, focus on its potential benefit to traders by examining how this metric could be paired with moving averages to build a potentially robust signal.

We continue this series on techniques with the MQL5 wizard that focus on alternative methods in Financial time series analysis for the benefit of traders. For this article, we consider the Hurst Exponent. This is a metric which tells us whether a time series has a high positive autocorrelation or a negative autocorrelation over the long term. The applications of this measurement can be very extensive. How would we use it? Well, firstly, we’d calculate the Hurst exponent to determine if the market is trending (which would typically give us a value greater than 0.5) or if the market is mean-reverting/ whipsawed (that would give us a value less than 0.5). For this article, since we are in a ‘season of looking at moving averages’ given the last pair of articles, we will marry the Hurst Exponent information with the relative position of the current price to a moving average. The relative position of price to a moving average can be indicative of price’s next direction, with one major caveat.

You would need to know if the markets are trending, or they are ranging (mean-reverting). Since we can use the Hurst Exponent to answer this question, it follows we would simply look at where price is relative to the average and then place a trade. However, even this may still be a bit of a rush, given that ranging markets tend to be better studied on shorter time periods than trending markets that are more apparent when looking at much longer time periods. It is for this reason that we would need two separate moving averages to weigh the relative position of price before a definitive condition can be assessed. These will be a fast-moving average for ranging or mean-reverting markets, and a slow-moving average for trending markets, as determined by the Hurst Exponent. So, each market type as set by the Exponent would have its own moving average. This article therefore is going to look at Rescaled Range Analysis as a means at estimating the Hurst Exponent. We will go through the estimation process a step at a time and conclude with an Expert Signal Class that implements this Exponent.

Author: Stephen Njuki

 

Hi Stephen,

I have enjoyed your Wizard articles immensely.    The Hurst article presented Auto Correlation results that were especially interesting.  I downloaded your sources and compiled and ran a test the the Hurst CTL EA.  The results were quite disappointing a loss of 3108 vs your gain of 89,145


I text compared the sources to your original and the only changes were to the include statements.  I used Forex.com as my data source.


Perhaps you can identify why the two results are so drastically different


Cheers,

CapeCoddah

 
CapeCoddah #:

Hi Stephen,

I have enjoyed your Wizard articles immensely.    The Hurst article presented Auto Correlation results that were especially interesting.  I downloaded your sources and compiled and ran a test the the Hurst CTL EA.  The results were quite disappointing a loss of 3108 vs your gain of 89,145


I text compared the sources to your original and the only changes were to the include statements.  I used Forex.com as my data source.


Perhaps you can identify why the two results are so drastically different


Cheers,

CapeCoddah

Hello,

Just seeing this. The results you get in strategy tester depend on the inputs to the Expert Advisor.  Usually, but not always, I use limit order entry with take profit targets on no stoploss. This is setup would not be ideal when considering taking these ideas further as a stoploss or maximum holding period, or some strategy that mitigates your downside would have to be considered.

Ideas presented here are purely for exploratory purposes and are not trading advice but replicating my strategy tester reports should be easy if you fine tune your inputs.

Thanks for reading.

 

Thanks for the response.


I presumed that the EA input specified in the downloaded zip was used to produce the profits illustrated in the BackTest.  I will review the inputs and adjust them to match your defaults.