a trading strategy based on Elliott Wave Theory - page 256

 
<br / translate="no"> Thank you, Sergey, a lot has now become clearer. It's not about what you calculate and how you calculate it, it's about understanding what you want to show.


Yeah, I know I'm a lousy storyteller. I explained as much as I could, I thought I'd better not repeat myself too many times. :о)))


As far as I now understand, the value of PE at a given point changes as the current count moves more and more to the right ? After all, the channel that connects this point and the current datum is changing.


Exactly right. Now add to that the dynamics of change and you can expand your knowledge of the process. Going back to the motorcyclist, you just need to abstract a bit from a classic physics problem. Suppose that at some point in time we know the equilibrium point and only it. It is quite difficult to say at once (I remind you, we are abstracted from the particular problem and know very little about the particular system) what he is doing, going straight or starting to turn and whether it is a sharp turn or not. This question, indirectly of course, can be answered by knowledge of the equilibrium on past motion timelines.

All I do is trace the dynamics of changes of local extrema (lows in this case) relative to the window N for each timeframe where we have observed the process of length N (it is ornate). In the picture you can see how windows are "formed" in time. Next, I simply combine them:



For this approach, the window of length N must always remain a constant value. The matrix, or surface, is of the following size [N: (N-zone)]. The choice of N itself is a separate story.
 
So your PE graph is the trajectory of a local extremum relative to the current reference frame ?
 
Good afternoon to the esteemed gathering.
Yesterday I came across a post that I found very interesting and in some ways overlapping with the topics discussed here (imho).
http://forum.fxclub.org/showthread.php?t=22097&page=3
it's a pre-preceeding post in a thread by a UP (long one)
 
Good evening
Here is the situation
If we take a sample (Close)anywhere EURUSD h1 216 bars and calculate on this sample the coefficients for a parabolic regression. F(x)=A0+A1*x+A2*x^2
After calculating the potential gradient
int shift=215;
for (int j=shift-3;j>=0;j--)
{
ArrayResize(a_Price,shift+3-j);
ArrayInitialize(a_Price,0);
int s=1;
for (int i=shift;i>=j;i--)
{
a_Price[s]=Close[i];
s++;
}
Raschet_koefficientov_paraboli(a_Price,shift-j);
double summGradienta=0;
for (int x=1;x<=shift-j;x++)
{
summGradienta+=Close[shift-x+1]-(A0+A1*x+A2*MathPow(x,2));
}
GP[j]=summGradienta*100000000000;
}
it turns out a funny number (it is always negative) and approximately in the - 0.0278 area
and if you run the indicator through history on visualization the outlines of this indicator remain constant especially the more sample the more stable.
most importantly outlines do not depend on timeframe and currency pair

essence of the function
Raschet_koefficientov_paraboli
IOC and system solution by inverse matrix
how it can be used ?
PS. This is my "unsuccessful" attempt at a post from solandr 08.07.06 20:12
pictures like there I can't get
Respectfully

PPS If anyone needs I will post my code here in full.
 
2 olyakish

To insert code, use the code tag. Then your text will be much easier to read.
Also, when you do the calculation of parabolic regression coefficients by ANC, you get a system of 3 uraniums. It is quite capable of being solved in general form. This results in 3 formulas for 3 regression coefficients which are not too complicated. Their calculation is much easier and, most importantly, more reliable than the inverse matrix construction.

In fact, I have nothing to say since there is no code. But if you put it out there, I think solandr will help you figure it out.
 
Here is the text of the indicator
//+------------------------------------------------------------------+
//|                                      Gradient_Potenciala_ind.mq4 |
//|                                                         olyakish |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "olyakish"
#property link      ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_level1 0
/*
#property indicator_level2 0.0254
#property indicator_level3 -0.0229
*/
#property indicator_minimum -0.03
#property indicator_maximum 0.03

double Matrica[4,5];
double det,det1; 
double Matrica`[4,4];
double A0,A1,A2;
double a_Price[];
double GP[],MA[],GP_Rev[];
int shift;
double NullGradient;

//---- функция расчета коэффициентов параболы типа F(x)=A0+A1*x+A2*x^2 
//---- передаем массив цен по которым происходит расчет коэффициентов и количество баров для расчета

int init()
  {
     SetIndexStyle(0, DRAW_LINE);
     SetIndexBuffer(0, GP);
     SetIndexLabel(0, "Gradient_Potenciala");
     SetIndexStyle(1, DRAW_LINE);
     SetIndexBuffer(1, MA);
     SetIndexLabel(1, "MA");
     
     shift=iBarShift(NULL, 0, ObjectGet("Start", OBJPROP_TIME1),false);
     SetIndexDrawBegin(0, 10);
    return(0);
  }

void Raschet_koefficientov_paraboli(double Mass_Price[], int bars_in)
   {
     
    //---- метод наименьших квадратов и решение системы уравнений обратной матрицей
    // --- имеем заполненную матрицу 3*4   
   ArrayInitialize(Matrica,0);
   ArrayInitialize(Matrica`,0);
   Matrica[1,1]=bars_in;
   for (int i=1;i<=bars_in;i++)
      {
         Matrica[1,2]+=i;
         Matrica[1,3]+=MathPow(i,2);
         Matrica[2,3]+=MathPow(i,3);
         Matrica[3,3]+=MathPow(i,4);
         Matrica[1,4]+=Mass_Price[i];
         Matrica[2,4]+=Mass_Price[i]*i;
         Matrica[3,4]+=MathPow(i,2)*Mass_Price[i];
      } 
    
    Matrica[2,1]=Matrica[1,2];
    Matrica[2,2]=Matrica[1,3];
    Matrica[3,1]=Matrica[2,2];
    Matrica[3,2]=Matrica[2,3];


   
   // ее det
    det= (Matrica[1,1]*Matrica[2,2]*Matrica[3,3]+Matrica[2,1]*Matrica[3,2]*Matrica[1,3]+Matrica[1,2]*Matrica[2,3]*Matrica[3,1])-
         (Matrica[1,3]*Matrica[2,2]*Matrica[3,1]+Matrica[1,2]*Matrica[2,1]*Matrica[3,3]+Matrica[1,1]*Matrica[2,3]*Matrica[3,2]);
   //Comment ("det=",det);
   //обратную матрицу
   Matrica`[1,1]=((Matrica[2,2]*Matrica[3,3])-(Matrica[2,3]*Matrica[3,2]));
   Matrica`[1,2]=-((Matrica[2,1]*Matrica[3,3])-(Matrica[2,3]*Matrica[3,1]));
   Matrica`[1,3]=((Matrica[2,1]*Matrica[3,2])-(Matrica[2,2]*Matrica[3,1]));
   
   Matrica`[2,1]=-((Matrica[1,2]*Matrica[3,3])-(Matrica[1,3]*Matrica[3,2]));
   Matrica`[2,2]=((Matrica[1,1]*Matrica[3,3])-(Matrica[1,3]*Matrica[3,1]));
   Matrica`[2,3]=-((Matrica[1,1]*Matrica[3,2])-(Matrica[1,2]*Matrica[3,1]));
    
   Matrica`[3,1]=((Matrica[1,2]*Matrica[2,3])-(Matrica[1,3]*Matrica[2,2]));
   Matrica`[3,2]=-((Matrica[1,1]*Matrica[2,3])-(Matrica[1,3]*Matrica[2,1]));
   Matrica`[3,3]=((Matrica[1,1]*Matrica[2,2])-(Matrica[1,2]*Matrica[2,1]));
   //расчет коэффициентов параболы A0-с, A1-b, A2=a
      
   A0=(Matrica`[1,1]*Matrica[1,4]+Matrica`[1,2]*Matrica[2,4]+Matrica`[1,3]*Matrica[3,4])/det;
   A1=(Matrica`[2,1]*Matrica[1,4]+Matrica`[2,2]*Matrica[2,4]+Matrica`[2,3]*Matrica[3,4])/det;     
   A2=(Matrica`[3,1]*Matrica[1,4]+Matrica`[3,2]*Matrica[2,4]+Matrica`[3,3]*Matrica[3,4])/det; 

   
   return(0); 
   }
   



int start()
  {
  if(ObjectFind("Start")!=0) {Comment ("Вертикальная линия Start не найдена");}////return(0);}
  else {Comment ("Вертикальная линия Start на баре  ",iBarShift(NULL, 0, ObjectGet("Start", OBJPROP_TIME1),false) );}
shift=iBarShift(NULL, 0, ObjectGet("Start", OBJPROP_TIME1),false);

shift=215;
GP[shift+1]=0;
GP[shift]=0;
GP[shift-1]=0;
GP[shift-2]=0;
for (int j=shift-3;j>=0;j--)  
   {
      ArrayResize(a_Price,shift+3-j); 
      ArrayInitialize(a_Price,0);
      int s=1;
      for (int i=shift;i>=j;i--) 
         {
          a_Price[s]=Close[i];   
          s++;
         }
         Raschet_koefficientov_paraboli(a_Price,shift-j); 
      double summGradienta=0;
      for (int x=1;x<=shift-j;x++)
          {
          summGradienta+=Close[shift-x+1]-(A0+A1*x+A2*MathPow(x,2));
          }
   GP[j]=summGradienta*100000000000;
   }
   SetIndexLabel(0, "Gradient_Potenciala"+GP[1] );
   Comment (GP[1]);
 ////////////////////////------------------------------------------------------------ 
  //-0.0216
      
    /*  
      
      ArrayResize(a_Price,shift+2); 
      ArrayInitialize(a_Price,0);
      int s=1;
      for (i=shift;i>=1;i--) 
         {
          a_Price[s]=Close[i];   
          s++;
         }
     */
  /*   
     for(i=1;i<=200;i++)
      {
       a_Price[s]=Close[2]-100*Point+i*Point;      
       Raschet_koefficientov_paraboli(a_Price,shift-1);
       summGradienta=0;
       for (x=1;x<=shift-j;x++)
          {
          summGradienta+=Close[shift-x+1]-(A0+A1*x+A2*MathPow(x,2));
          }
    summGradienta =summGradienta*1000000000;  
 //   Alert(Close[2]-100*Point+i*Point,"=",summGradienta);
      }
      
*/
  /*
   
   ArrayResize(GP_Rev,ArrayRange(GP,0));
   ArrayCopy(GP_Rev,GP,0,0,WHOLE_ARRAY);
  // ArrayIsSeries(GP_Rev);
  ArraySetAsSeries(GP_Rev,1);
   int ma_period=25;
   for(i=shift-ma_period-15;i>=1;i--)
   {
  MA[i]= iMAOnArray(GP_Rev,0,ma_period,0,MODE_SMA,i);
   }

*/   
   
 //  MA[2]= iMAOnArray(GP_Rev,0,10,0,MODE_SMA,2);
 //  MA[3]= iMAOnArray(GP_Rev,0,10,0,MODE_SMA,15);
 //  Comment ("MA[1]",MA[1]);
   return(0);
  }
//+------------------------------------------------------------------+



Look at what it draws on the visualisation.

 
Honestly, it's very difficult to understand someone else's code. I can only assume that this is not exactly how you do the summation. I can only state my idea of calculation again. Maybe a clearer explanation would help? My algorithm looks like this:
1. we take a sample of for example the last 100 bars [99,0]. For this sample we want to see how the force gradient influencing on the price-ball rolling along the curved inclined groove changed. We assume that this same trough starts at bar 99 and ends at 0.
2. we assume that for calculation of the force gradient acting on the ball at some specific point of the trajectory, for example on 45 bar, we are not interested at all in the form of the groove that it will pass after this bar. That is, we are not interested in the interval [44,0]. Thus to calculate the gradient of force acting on the ball on bar 45 we consider the segment [99,45].
3. For this interval [99,45] we find the parabola by means of MNA. The gradient of force acting on the ball-price will be equal to the difference between the price at point 45 and the value of the approximating parabola.
4. Then we want to get the values of the gradients acting on the price-ball for the whole length of its motion along the segment [99,0]. For this purpose we will have to repeat steps 1-3. That is, we take the segments [99,95],[99,94],[99,93]........[99,2],[99,1],[99,0] and find the gradient values for each segment.
5. Now we sum up the gradients obtained in item 4. We get the value of the sum of gradients of forces acting on the ball-price for the given point 99. So this is the value we can draw on the graph. This will be the point on the timeline located at bar 99.
6. Next, we want to get the value of the sum of the gradients for the other points of this our trough [99,0]. To do this, we must take in turn the corresponding troughs [98,0],[97,0],[96,0]......[6,0],[5,0],[4,0]. And for each of the grooves, repeat steps 1-5. As a result on the chart we will get a wave structure like this, starting on bar 99 and decaying on bar 0.

PS: In the picture of solandr 08.07.06 20:12 the summation of gradients was modulo. But then I started using simple algabraic summation and points of transition through 0 of this structure are points of appearance of real channels acting at the current moment in time. "trading strategy based on Elliot wave theory" solandr 27.08.06 21:05
I am carrying out absolutely the same procedure for ligne regression channels. I also get the wave structure and from it the timeframes of the channels acting at the current moment in time.
 
<br/ translate="no"> So your PE graph is the trajectory of a local extremum relative to the current datum?


Hi Yuri! Sorry for the delay, been a bit busy with important things. Ok, I'll try to explain everything in order. Especially since I've been talking about Hearst's exponent and haven't talked about potential energy yet.

In general, I am a little confused, because what I will write about below, we have already discussed many times, including channels, PE and the dead zone, (except for some minor aspects). Well, never mind, at least we'll repeat what we've learnt and Vladislav, as an ideologist, will correct us. :о)

Of course, this isn't my whole model, or rather not a model at all. There is no fragment of the Elliott Wave Theory, foundations of the model - the Hurst Index, MSP in its entirety, "waves of fractal structure" and many other things, as well as the connection between these components. I consider PE and its use in isolation, rather than describing my model.

Potential energy (PE) of the channel

I will begin with the PE graph itself. From the current datum (in other words from zero at some definite moment of time) a price sample is taken, for example (H+L)/2 number of N bars (or samples). This price sample is input for calculation of EP. If we go in increments of +1 in history, each such iteration will limit the sample to a length of n to N. In this case, it does not matter whether to go from 0 to N or from N to 0. For each such channel, PE is calculated. As a result, one channel is assigned one value of potential energy. This is eloquently demonstrated by the figures (note the high artwork :o)

n=5


As I wrote earlier, channels with lengths less than the dead zone boundary are not taken into account, but it should be noted that when calculating PI the remaining channels include this section. There is a similar segment for the Hurst index, when the calculation for a very small sample can a priori contain big errors and the calculations are not carried out on it. In my model, the length of this interval is not set; it's selected on the basis of analysis of the price series near the current datum.

And this is the variant for n=8. The next iteration gives us a price sample of 8 samples, for which one PE value is calculated:



The obtained PE function has its extrema and each extremum corresponds to a channel of a certain length. Given the specifics of the method for calculating PE, the channels corresponding to local minima (i.e. not just the smallest extremum) are of particular interest. Their values, position relative to the window of length N, combined with additional channel characteristics, give a nesting hierarchy. An upper-level (parent) channel with a high potential is identified among the candidates. This is not necessarily the longest channel. The notion of greater 'potential' is here interpreted according to the MSP. Coupled with a minimum value of potential energy, this could be said to be the most stable channel.

A bit about sustainability. In general, this notion is rather elastic and for our case it also has a probabilistic nature. For example, on the pages of a physics textbook a cyclist is riding. Being in equilibrium and taking into account ideal conditions of his existence, he can ride forever. On the street, it's not so perfect. I, for example, knew one cyclist on whom I wouldn't bet a cent that he would be in equilibrium, i.e. riding for at least another 10 minutes. Admittedly, that was me. :о))) Similar is the case with the Hearst indicator persistence estimation, which also has a probabilistic nature.

The calculated graph, as well as additional characteristics should be regarded as initial conditions of the System existence, which of course will change.


For clarity, I will replace "potential" with "energy" of the channel. Will the channel exist forever? Of course not, one day it will lose its energy and cease to exist. Where will it spend it? My humble opinion - it will give it to other channels. Or, philosophically speaking, other channels will take it away. And how do you trace the leakage of energy from a channel? ...What was I saying, ah yes, sorry, I got distracted. I will say no more.

Let me give you an example of calculation from a "random" zero bar. "Randomness" is due to the non-random selection of one of the typical, in my opinion, difficult areas on the graph. This will become apparent later on. So, I fix the current reading, and calculate the PE for N=130, the dead zone is assumed to be 30. As a result, we have 130-30=100 channels, and for each channel I calculate the value of PE. I have obtained such a chart with the (H+L)/2 price series superimposed.



This chart contains four channels that have minimal PI values. Further, channels are identified by their counts (channel length is calculated as 130 - (count of a local extremum))
25 counts
51 counts
88 counts
117 counts

As a result, we go from a System of 100 channels to a System of 4. Let's look at each channel individually:

25 count PE Top level channel (Parent).



Lower level channels

51 PE count


Quite a curious channel. Seems to be just as powerful, but you can see that the channels are scattered.



This means that the two channels are going to be competing for energy: one is going to carry it one way, the other is going to carry it the other way. The directions of transfer, in general, are not very much the same. I wonder who is going to take energy from whom.

88 PE count



117 PE count The channel has the smallest value of potential energy compared to the others.



So what to do with these channels? Of course, look for reversal zones. This requires a good model. One of the easiest options discussed on this forum is to look for intersections of lower order channels with each other and with the parent channel. It is only necessary to know which intersections to look for; besides, the choice of channel boundaries is important. After all, each channel is represented by three lines: the centre line, usually a linear regression, and the lower and upper boundaries. The intersection of the two channels forms nine points.



If you find the intersections of all the channels with all of them, you get a decent number.


I will skip the tedious story about construction of reversal zones, and proceed directly to the result. First of all, this only applies to a specific PE calculated using my method. I will only note that the calculated PE function is only the initial conditions of the System (in this case, the System is four channels, not 100),

We got the following pivot zones for the channels, participants




Let's look at the fact. This may not be the most difficult section to predict, but it is different in that the stable channels are starting to lose energy, while the new channel that will inherit it has not yet been clearly formed. It is in its infancy, somewhere in between.



Dynamic model

In order to build a dynamic model, the graph must satisfy a simple condition, namely the calculated values must not depend on the sample length. This should be understood as follows: a large sample from a fixed current datum shall include the values of smaller estimated samples. For example:

N=5
Counts: 0 1 2 3 4
Values: 3 4 2 2 7

N=10
Counts: 0 1 2 3 4 5 6 7 8 9
Values: 3 4 2 2 7 5 1 2 2 1

In practice it looks like this:



In general it is nothing special, but the property is very important just for the dynamic model and for this reason I highlighted it.

Now for the dynamic model itself. Let us take one hour chart as an example. Suppose that it is 16:00 of some trading day. What do I want to do? Roughly speaking, perform the briefly described actions above. From the zero bar that corresponds to 16:00, I plot a EP chart with the length of N historical bars (counts). The figure shows this fact:



Now let's remember what I was doing an hour ago, i.e. at 15:00. If you didn't drink beer, you must have plotted the PE chart in the same way:



The price series input samples at 16:00 and 15:00 will differ from each other only by the two most extreme values. And this should certainly have a minor effect on the PE charts. But how? Let's take the current example above (let's assume that the EP chart was calculated for 16:00) and plot one hour ago, i.e. at 15:00:



. We can see that the number of local extrema remains the same but there are slight changes, namely, internal movement relative to the window. Actually, what did I expect? The local extrema also change their position with respect to the window of length N (remember that the window is a fixed value) and energy levels change, while the shape of the curve remains practically the same. At 16:00 the parent channel on the PE plot had a count of 24 (channel length 106). At 15:00 (which also remains the parent channel), the reading was 22, which is equal to channel length 108. It should also be noted that there was no rearrangement of channel levels. The main channel loses length and stability.

At some point I thought, why not look further into the story, as if "freezing" the window, watching the process through it.




All that remains is to combine (although this is not the only construction) all graphs for N hours (time is of course not important here, it can be minutes, hours, days, etc.). We get the following:



This is a simple way to get the raw data (matrix) for dynamic analysis. This is only the very first step and application is considered to analyse the dynamics of local minima, and generally speaking, more additional information can be obtained from it. And even this simple application provides a lot of useful information. You can see how channels are rearranged, changing their structure and hierarchy. How, for example, two channels can merge into one or vice versa, split into several. And I talked about one such criterion in the last post.

Here is a matrix for this example (it is not only beautiful but also cognitive, the main thing is to expand consciousness :)



PS: Yuri, put all the power of artistic and visual word in this post. I hope it will become more understandable. Here, I only have a request, if again it will not be clear, write that all is clear, otherwise you will develop in me an inferiority complex, and I'll have to spend on an expensive brainiac. Just kidding!!! :о))))

Sorry, the pictures are a bit bigger than I wanted them to be.
 
Hi Sergei !
Now it is clear that your PE is not a function but a function, it is clear how the dynamic picture is built, how the channels are defined and what they have to do with the PE.

Only the method of calculating PE is left out of the picture, but this is correct. Otherwise the discussion of some aspects of the model would have turned into an elementary publication. And such a goal, I hope, is not worthwhile.

So I wonder what results such a multi-component and mathematically rich system will lead to.
 
Thank you, grasn, once again you have convinced me that I am on the right track. It is true that my potential energy distribution function is multidimensional, but on any orthogonal plane of functional space it looks approximately the same. For my analysis I use a complex of neural nets, architecturally connected with each other.
The grid has to take into account the "flow" of energy from channel to channel. and define the reversal zones separately for each of the channels. After that I make a parabolic approximation and synthesize a function graph (price graph) using the wave function. The problem of strong distortions due to edge effects remains unsolved. I am working on it now - I have some ideas. The results are not impressive yet. Calculations take 5 minutes. It takes me 24 hours to train the grid.

P.S. All coincidences with your system please consider casual. Since I can not copy as your system has not seen:).

I can't copy your system because I have not seen it at all:) cooper123. I am not wasting my time with Cagi paternas. Imho!
Reason: