Monday, May 17, 2010

Variation of the Hurst Exponent

While playing around with various strategies, I came to consider that an interesting way to use the fractal dimension is to look at its variations rather than its absolute value. Furthermore such an approach makes sense at a mathematical point of view: from equation (1) in this post, applying the functional power rule of derivation, we can see that:

Rearranging it, we get:

Asymptotically (for t sufficiently high), we can then see that the sign of the variation of H with time gives us the sign of the variation of the variance over time, and when this variation is positive, it indicates an increasing volatility and is therefore the best time to enter a trade. It must be noted that this indication does not say anything about the sense of the trade we should enter, and it therefore ought to be combined with a directional indicator in order to be fully operational.

Even though most of such variations can be seen by just looking at the FGDI graphic, it is just as easy (and possibly adding some precision) to program a new indicator that displays the variations of H over time, the script of this indicator can be found here on MQL4.
Below the indicator Hurst_Difference is displayed in the lower window on a 1hr chart for EUR/USD:

Whenever this indicator display a value above 0, it indicates a potential entry for a trade.
The parameters of Hurst_Difference.mq4 are:
f_period (integer): This is the period considered for calculating the fractal dimension, default is 30.
type_data (0,1,2,3,4,5 or 6): This is the type of price the indicator will consider (0=CLOSE, 1=OPEN, 2=HIGH, 3=LOW, 4=MEDIAN, 5=TYPICAL, 6=WEIGHTED), default is 0.