Market etiquette or good manners in a minefield - page 74

 
Neutron >> :

I'm wrong far more often than you might imagine (almost always).

Structurally, the codes for Kaga and Renko are identical. The algorithm contains two comparison operators. The only difference is in one of them - for Kagi the vertex is defined to a quotient discreteness, for Renko the vertex is defined to a partitioning step H.

And if you were able to stick the Renko algorithm into three lines, then consequently Kagi will automatically (to the fairness of my assertion) satisfy this condition.

Look closely, I have independent indexing for cotier, and for Kagi-building. I not only output from the subroutine the vertical coordinates of the Kagi counts, but also their indices in the cotier coordinates...

OK, here's a little script, with a renko algorithm. You could write it in 3 lines, but it's still 15 operators. Including assignment, branching, etc. Minus outputting the results to a file.

//+------------------------------------------------------------------+
//|                                              test_Renko_Kagi.mq4 |
//|                                Copyright © 2009, HideYourRichess |
//+------------------------------------------------------------------+
int      rand[];
int      Series = 65000;
int      H = 7;

int start()
  {
   int csvHandle = FileOpen( "test_Renko_Kagi" + ".csv", FILE_CSV| FILE_WRITE, ';');
   if( csvHandle > 0) {
    ArrayResize( rand, Series);
    
    rand[0] = 0;
    MathSrand( TimeLocal());
    for( int i = 1; i < Series; i++) { rand[ i] = rand[ i-1] + (MathRand() - 16383) / 4000; }
    
    int renko = rand[0];
    FileWrite( csvHandle, 0, rand[0], renko);
    
    for( i = 1; i < Series; i++) {
     if( MathAbs( rand[ i] - renko) < H) {
      FileWrite( csvHandle, i, rand[ i]);
     } else {
      while( rand[ i] - renko >= H) { renko = renko + H; }
      while( renko - rand[ i] >= H) { renko = renko - H; }
      FileWrite( csvHandle, i, rand[ i], renko);
     }
    }
    
   }
   if( csvHandle > 0) FileClose( csvHandle);
   return(0);
  }

The algorithm can work correctly on data with gaps, gaps, etc. And this is good and useful.


Here's the figure. The blue is the data, the red is the renko.


The disadvantage of the algorithm, - it exposes intermediate points, in areas where there is a monotonic rise or fall. Which is not very true, because in order to get the values of H-volatility we'll have to perform additional processing ("remove" the intermediate points), which means that actually there are more operations than it seems.


For kaga, the algorithm is more complicated, both in logic and in the number of operators.


Now the questions are,

1. What should be done with this renko-algorithm to make it shorter?

2. What should be done to make this renko algorithm cagey without making it more complex?


I can't see any reasonable solutions yet, but you're saying it's simple and possible.

 

Here, it seems to have worked out kagi. I'd be happy to have someone check it out.



 
HideYourRichess писал(а) >>

For Kaga, the algorithm is more complex, both in logic and in the number of operators.

If we take as the basis the algorithm described in Pastukhov's work, the difference between Renko and Kaga is exactly in the discretization step of the vertex along the vertical axis. This is what I am talking about above.

Thus you and I have no agreement in our understanding at the level of the algorithm. Obviously, we need to deal with this issue first.

paralocus wrote >>

Here, it seems to have worked out kagi. I'd be happy to have someone check it out.

Paralocus, send us the cotier file and the program, then we can compare. Or explain what your P and m parameters are.
 
I have attached the listing and quotes. Parameter P is a series of Open(in this case GBPUSD minutes - available in the archive) Parameter m is the number of elementary base splits s in one kagi step
Files:
kagi.rar  163 kb
 
Neutron >> :

If we take the construction algorithm described in Pastukhov's work as the basis, the difference between Renko and Kaga is exactly in the step of discretization of the vertex along the vertical axis. This is what I was talking about above.

Thus you and I have no agreement in our understanding at the level of the algorithm. Obviously, we need to deal with this issue first.


I get the impression that you don't have such an algorithm, namely the kagi algorithm is no more complex than the renko algorithm.


Let's deal with that first and then my understanding.


Another point, the issue is the processing of the beginning of the row. Here is your drawing for example.




In my opinion, the beginning is not quite clear. Why did you decide to do it that way? From the point of view of correspondence of trading algorithm and partition algorithm, it is desirable that the first point coincides with the first vertex.


In addition, the question of correct handling of "gaps" in the data remains open.

 
paralocus >> :

Here, it seems to have worked out kagi. I'd be happy to have someone check it out.

It's not a kagi. The local vertices are skipped.

 
HideYourRichess >> :

These are not kagi. The local nodes are skipped.

Can you be a little more specific? According to the kaga partitioning algorithm, local vertices will sometimes be skipped.

 
paralocus >> :

Can you be a bit more specific? By the algorithm of kaga splitting local nodes will be sometimes missed.

No, it can skip at Renko, never at Kagi. On the neutron graph, these are the red and blue dots. It's just that your kagi aglorythm is not correct. I have already given the correct algorithm (quite correct, there is a small problem with the beginning of the row) from Candid. Algorithm indicated in Pastukhov's dissertation, the same, unfortunately, is not quite correct in processing beginning of rows.


I need it to be like this.


The red ones are the cagi tops, or zigzag tops. Green, "no-return" points - the place where it is determined that the next vertex of the cage is fully formed. The dark blue dots are the data.

 
HideYourRichess >> :

The algorithm given in Pastukhov's dissertation is, unfortunately, not quite correct either, in processing the beginning of a row.



Unfortunately Pastukhov's dissertation far exceeds the level of my ability to understand mathematics.

 
paralocus >> :

Unfortunately Pastukhov's dissertation far exceeds the level of my ability to understand mathematics.

Well, forget it then. Several things are mathematically proved there, and it is of interest to mathematicians. And the conclusions are pretty simple, and mostly described in words. Essentially, H-volatility is a non-parametric statistic. The main conclusion is that if H-volatility equals 2H then arbitrage on such a series is impossible (proven mathematically). Otherwise, arbitrage is possible. There are two strategies, depending on whether H-volatility is greater or less than 2H. These are the basics. Plus some remarks about patrons etc.

Reason: