Hearst index - page 5

 
Yurixx:

There are indeed several methods of calculating Hearst, but I would caution you to assume that only grasn has the right one. In fact there is not a lot of maths there, so any of the methods can be figured out. You just have to take the code and experiment with different rows.
The main question is whether to use logarithm ratio or straight line approximation?
All (in particular Peters) and everywhere (found on the Web dissertations) except Federer (and even implicitly) use the ratio of logarithms. Although in the discussion almost all recognized that it is necessary to approximate the straight line. I'm not a mathematician, just a reader :)
So that's not ahchy maths...
 
Gorillych писал (а):
Yurixx:

There are indeed several methods of calculating Hearst, but I would caution you to assume that only grasn has the right one. In fact there's not a lot of maths there, so any of the methods can be figured out. You just have to take the code and experiment with different rows.
The main question is whether to use logarithm ratio or straight line approximation?
All (in particular Peters) and everywhere (found on the Web dissertations) except Federer (and even implicitly) use the ratio of logarithms. Although in the discussion almost all recognized that it is necessary to approximate the straight line. I'm not a mathematician, just a reader :)
So that's not ahchy maths...

Peters has Hearst's exponent = the angular coefficient of the regression line plotted on a set of points (Log(R/S),Log(N/2)).
A simple ratio of these logarithms will give the angular coefficient not of the approximating line, but of the radius-vector of a point with coordinates (Log(R/S),Log(N/2)). The difference can be substantial, especially if there are few points in the sequence.
 
I am not inspired by Hearst's calculation by grasn's method. With all my respect to him (I do not have a bit of his experience and knowledge), this is not how an indicator based on the Hearst index should look:


. As the geometrical meaning of the Hearst index is the angular coefficient of the regression line, it seems very strange that this coefficient changes with the reactive speed. Therefore I decided to write my own indicator based on Hearst's index. In the first variant I built it on the basis of closing price series. If we consider the indicator on the basis of all series simultaneously, the result looks the same but it is several bars faster. It already looks better, though a bit strange for the angular coefficient of the regression line:) In general, we have the following indicator:



Hearst Ratio for it ranges from 0.2 to 0.9. It fluctuates smoothly but it is not very good where it varies. Although, the indicator is interesting in general.)

The algorithm is given below for Hearst's connoisseurs:
.
for(int j=limit;j>=0;j--)
      {
         int max_index=ArrayMaximum(Close,HerstPeriod+j,j);
         int min_index=ArrayMinimum(Close,HerstPeriod+j,j);
         MaxH=Close[max_index];
         MinH=Close[min_index];
         R=MaxH-MinH;
         Average=iMA(NULL,0,HerstPeriod,0,0,0,j);
         sum=0;
         for (int i=1;i<=HerstPeriod;i++)
             sum+=MathPow((Average-Close[i+j]),2);
         double S=MathSqrt(sum/(HerstPeriod-1));
         if (S>0)
            ExtMapBuffer1[j]=(MathLog(R/S))/(MathLog(HerstPeriod*a));    
      }

It seems to be correct.
Files:
 
After that I have calculated Hearst index for price difference, as grasn tried to do . The price series was taken as the closing price series. Algorithm:
      for(int j=limit;j>=0;j--)
      {
         ExtMapBuffer2[j]=Close[j]-Close[j+1];
         int max_index=ArrayMaximum(ExtMapBuffer2,HerstPeriod+j,j);
         int min_index=ArrayMinimum(ExtMapBuffer2,HerstPeriod+j,j);
         MaxH=ExtMapBuffer2[max_index];
         MinH=ExtMapBuffer2[min_index];
         R=MaxH-MinH;
         for (i=1;i<=HerstPeriod;i++)
            sum+=ExtMapBuffer2[i+j];
         Average=sum/HerstPeriod;
         sum=0;
         for (i=1;i<=HerstPeriod;i++)
             sum+=MathPow((Average-ExtMapBuffer2[i+j]),2);
         double S=MathSqrt(sum/(HerstPeriod-1));
         if (S>0)
            ExtMapBuffer1[j]=(MathLog(R/S))/(MathLog(HerstPeriod*a));    
      }

remains the same. The only difference is that the calculation is not based on a series of closing prices, but on their difference. The result was staggering:





The result is what it should be - 0.5. It means that the series is really chaotic! And it looks like this on all currencies and timeframes below D1. It is 0.3-0.4 on the daily timeframes. It means persistence, i.e. reversion to the mean. The period for the index calculation is 500. In terms of H1 it is approximately for one month.

The conclusion based on the Hurst indicator is that price series on Forex are chaotic and unpredictable :)
If my calculations are wrong - please correct.

However, I have done too little research for such conclusions. Those who will investigate - please post all of them in a branch or send them to favoritefx [woof-woof] mail.ru.

Files:
 
>>>forex price series are chaotic and unpredictable
Here in this thread the author makes some research on chaotic price series in Forex. Perhaps you will be interested to take a look, if you decide to deal seriously with what we deal with at Forex. In my opinion it is very informative.
 

Hello all.

I came to this thread completely by accident, I didn't even know that my research on the Hearst index was of interest to anyone. If I may, I will add my comments. Of all the things I have tried to do, I have done them all. The calculation of the index given at https://www.mql5.com/ru/forum/50458 I haven't used for a long time. Also note that I have not published everything and for various reasons I will not do so (if I do, I will publish it in abridged form).

As for Hearst's value all the time 0.5, it is an excellent result that allows traders to save all their money.

Generally speaking, Hirst discovered the phenomenon, and the index (named after him) is its quantification. And this is the main thing! And the 0.5 result is just one point of view on a very complex process. Explaining simply, it depends on what kind of movement you are investigating. By the way, what are you researching and what do you want from Hirst? I don't have to tell you that, but you have to make up your own mind.

A very smooth Hearst figure is either a calculation error or a very rough estimate. It inherently cannot be super smooth.

The "simple maths" you see on the links on the internet is actually not quite correct (I'm not writing that it's wrong). Some more simple maths needs to be added to it.

Not in terms of bragging, but as a result of my model using the Hearst index: https: //www.mql5.com/ru/forum/50458 "grasn 11.01.07 16:16". I'll post a sequel soon, if of course the forum doesn't "die".

Good luck.

 
grasn:

Hello all.

I came to this thread completely by accident, I didn't even know that my research on the Hearst index was of interest to anyone. If I may, I will add my comments. Of all the things I have tried to do, I have done them all. The calculation of the index given at https://www.mql5.com/ru/forum/50458 I haven't used for a long time. Also note that I have not published everything and for various reasons I will not do so (if I do, I will publish it in an abridged form).

Hello!
Very glad, it was uncomfortable to ask questions in that branch and litter it with my uneducatedness.
I am reading that thread carefully and now I am trying to understand something as much as I can.
You may be saying somewhere there that you think that Sergei's version of Hearst index is correct. Please explain.
Thank you!
Good luck!
 
Gorillych:
grasn:

Hello all.

I came to this thread completely by accident, I didn't even know that my research on the Hearst index was of interest to anyone. If I may, I will add my comments. Of all the things I have tried to do, I have done them all. The calculation of the index given at https://www.mql5.com/ru/forum/50458 I haven't used for a long time. Also note that I have not published everything and for various reasons I will not do so (if I do, I will publish it in abridged form).

Hello!
Very glad, it was uncomfortable to ask questions in that thread and clutter it up with my ignorance.
I am carefully reading that thread and now I am trying to understand something as much as I can.
You may have said somewhere there that you think that Sergei's version of Hearst index is correct. Please explain.
Thank you!
Good luck!
You are very self-critical and I think you are right. That is the purpose of forums, to communicate, ask questions, discuss, etc. The method for calculating the Hurst Index proposed by Sergei is indeed very interesting. I recommend to have a look at it as well.
 
favoritefx писал(а) >>
After that I have calculated Hearst index for price difference, as grasn tried to do . A series of closing prices was taken as the price series. Algorithm:

It remains the same. The only difference is the calculation not by series of closing prices but by their differences. The result was simply stunning:





It came out as it should be - 0.5. That is the series is really chaotic! And it looks like this on all currencies and timeframes below D1. It is 0.3-0.4 on the daily chart. It means persistence, i.e. reversion to the mean. The period for the index calculation is 500. In terms of H1 it is approximately for one month.

The conclusion based on the Hurst indicator is that price series on Forex are chaotic and unpredictable :)
If my calculations are wrong - please correct.

However, I have done too little research for such conclusions. Those, who will do researches - please write everything on this site or send to favoritefx [woof-woof]mail.ru

This is not Hearst.

         ExtMapBuffer2[ j]=Close[ j]-Close[ j+1];
         int max_index=ArrayMaximum( ExtMapBuffer2, HurstPeriod+ j-1, j);
         int min_index=ArrayMinimum( ExtMapBuffer2, HurstPeriod+ j-1, j);
         MaxH= ExtMapBuffer2[ max_index];
         MinH= ExtMapBuffer2[ min_index];

As you can see from the code, the maximum and minimum are taken for the original series, not for rescaled (with the scaling changed).

Further on, there seems to be an error as well. The formula R/S=c*n^H after logarithmation should look like this: log(R/S)=log(c)+H*log(n), where H=[log(R/S)-log(c)]/log(n)

ExtMapBuffer1[j]=(MathLog(R/S))/(MathLog(HurstPeriod*a));

The constant c has somehow moved to n rather than R/S.

Why should the constant for market returns be two all of a sudden? What is this secret that I don't know it? ;)

Anyway, help a retard, does anyone have a calculation of Hurst exponent in mql4 or anything else common? grasn?

Dear Metaquotes, is calculation of Hurst exponent going to be implemented in MQL5?

 

Hirst discovered his empirical law while studying the Nile. Many other natural phenomena subsequently turned out to be well described by this law. It turns out that temporal sequences of measurements such as temperature, river runoff, rainfall, thickness of tree rings or height of sea waves can be investigated using the normalized spread or Hearst method. Such sequences are characterized by the H exponent, the Hurst index.

Temporal sequences with H above 0.5 are referred to the class of persistent - maintaining the existing trend. If the increments were positive for some time in the past, i.e. there was an increase, they will continue to increase on average. Thus, for a process with H > 0.5 a tendency to increase in the past means a tendency to increase in the future. Conversely, a decreasing trend in the past means, on average, a continuing decreasing trend in the future. The greater the H, the stronger the trend.

With H=0.5 there is no significant process trend and there is no reason to believe that there will be one in the future.

The case of H < 0.5 is characterised by antipersistence - growth in the past means a decrease in the future and a downward trend in the past makes an increase in the future likely. And the smaller H is, the greater the probability. In such processes, after a variable increases there is usually a decrease, and after a decrease there is usually an increase.

PS ...if anyone is interested

Reason: