a trading strategy based on Elliott Wave Theory - page 76

 
An important point - are objects not created or drawn? Can the properties of un-drawn objects be read?
 
Here is a new surprise - drawing of arrows does not change the time of run, it is interesting.
The time is 4-odd minutes, it hasn't actually changed.

2006.07.08 19:35:45 HistoryChannells EURUSD,M30: deinitialized<br / translate="no"> 2006.07.08 19:35:45 HistoryChannells EURUSD,M30: Running deinit()
2006.07.08 19:35:45 PM HistoryChannells EURUSD,M30: Optimized algorithm time 261281 ms
2006.07.08 19:31:24 HistoryChannells EURUSD,M30: initialized
2006.07.08 19:31:19 HistoryChannells EURUSD,M30: loaded successfully
2006.07.08 19:31:11 Compiling 'HistoryChannells'
 
An important point - are objects not created or drawn? Can the properties of unpainted objects be read? <br / translate="no">


Objects are created - I specifically checked, you can even see the property of the "invisible" arrow. Here is the code:
     centerLR=BestChannels[0][2]*(lastBar-1)+BestChannels[0][3]; ObjectCreate("up "+UpArrowCounter,OBJ_ARROW,0,Time[lastBar-1],centerLR+BestChannels[0][5]);
      ObjectSet("up "+UpArrowCounter,OBJPROP_ARROWCODE,158); ObjectSet("up "+UpArrowCounter,OBJPROP_COLOR,Red);
      ObjectCreate("down "+DownArrowCounter,OBJ_ARROW,0,Time[lastBar-1],centerLR-BestChannels[0][5]); ObjectSet("down"+DownArrowCounter,OBJPROP_ARROWCODE,158); ObjectSet("down "+DownArrowCounter,OBJPROP_COLOR,Red); UpArrowCounter++; DownArrowCounter++;



but here is the drawing:

 
Hmmm... it turns out to be my fault, I'll have to check it tomorrow. That's enough for today.
 
Yes, I also checked it with this code
 for (i=0; i<50000;i++) { obj_name = i; ObjectCreate(obj_name,OBJ_TREND,0,Time[0],i,Time[1],i); ObjectSet(obj_name, OBJPROP_STYLE, DRAW_NONE);
    j = ObjectGet(obj_name, OBJPROP_PRICE1); Print(j); } for (i=0; i<50000;i++) { obj_name = i; ObjectDelete(obj_name); }


 
<br / translate="no">
Pictures should be in Latin characters only and preferably in *.png format (gif is not shown by link in this forum).


It's all done so, I say in the editor window, it appears normal, and as soon as I press the add or save button depending on what I add or modify the message it disappears and even disappears that I typed :(
 
Ok, I went the other way (they started to send me away for 30 seconds, although waiting 10 minutes does not help :( ) but anyway, I just wanted to show that at the moment I have a Jew, but it is probably not relevant
 
Here's a new surprise - drawing arrows doesn't change the runtime, which is interesting.

I have this effect, depending on how I run the algorithm discussed here, the execution time is either 0 or 16 ms. I suppose that in some cases the algorithm is executed continuously, while in other cases it is interrupted and the full terminal cycle is executed (because the numbers repeat stably). By analogy - can't the drawing happen after the end of calculations?
 
Vladislav 02.06.06 11:26 <br / translate="no"> As for the practical implementation, or rather the underlying methods, everything is quite simple: the quadratic function has coefficients that you need to pick in an optimal way - the regression gives a linear, more accurate estimate for its construction. And, accordingly, you will be able to estimate up to what limits (amplitude spreads) in the Taylor expansion (construction of the quadratic form) you can use this coefficient. Further, as for other coefficients, think for yourself. And to find minimum of potential energy you don't need to know price trajectory, but what is more important to know - potential gradient ;). That is, the dynamic state of its zero-potential - you have to count something for the zero-potential. And all this is sufficient to estimate - direct differentiation is not necessary.
If figuratively, "on your fingers", applying geometric imagery:
just imagine that there is a ball rolling on a surface (analogous to some rough terrain) (this is the price). You don't need to know the intricacies of the ball's construction in order to determine the areas of attraction of the ball's trajectory. It is much more useful to know the properties of this "rough terrain".

Vladislav 14.06.06 21:06
Quite right - I wrote about it, in fact, that the minimum of the potential energy functional serves as one of the criteria for channel selection. And it is a property of the potentiality of the price field, while I am not looking for the trajectory itself due to (again) the fact that all trajectories that fit within the confidence interval must be considered equivalent for a given probability. That is, the construction of projections comes down first to sample selection, then to linear algebra.

In continuation of the topic on which I have already written on page 33, I had one more idea about finding of a channel with minimal potential energy in series of consecutive channels satisfying the already mentioned conditions. What do we have by constructing a linear regression channel? We have a region limited by its borders, inside which price can move as it wants. The only condition that has been fulfilled is the condition that the price stays within that channel. Further, Vladislav said that all trajectories falling within the confidence interval must be considered equal for a given probability. Then we assume that price could move by a quadratic function during its movement - i.e. we do not violate the above statement. Especially since this statement proceeds from the assumption that the price field is potential. That is, for any moment in time (and for any sample) we can build an approximating parabola and say that, based on this sample, price had such a trajectory, around which it moved in this sample. Figuratively speaking it is such a parabolic sloping trough and a ball having multiple inhomogeneities on its surface. Now what can we take as the dynamic state of the zero-point potential? Since the ball does roll from the beginning of the channel to its end moving along our conditional oblique parabolic trough, the minimum of potential energy for this trough will of course be at the current time on the trajectory of this trough and, consequently, at the current time the force (potential gradient) tending to shift the ball to the trajectory of parabolic trough will act on the ball (price). Now how to find the magnitude and direction of this gradient? It's very simple - find the parabola by the method of ISC and then find the difference between the current price and this parabola (minimum of potential). Of course this difference can be both positive and negative. Further, due to the fact that the chosen linear regression channel must be the "true" one for the forecast, the sample should have both the known convergence conditions (RMS<SCO2/3) and any other conditions confirming such convergence. Vladislav's mentioning of minimum of potential energy functional led me to the idea that for this it is necessary that sum of potential gradients should be as small as possible for the channel in which we build these parabolic approximating troughs on which the ball rolls and which are the best description of our rough terrain. Of course I immediately tried to check this assumption in practice and I share the results on this link https://c.mql5.com/mql4/forum/2006/07/min_poten_energy.zip

What do we see on these charts? We can see the channel of a linear regression drawn using the method of minimum RMS in a series, which I use in my Expert Advisor at the current moment. On a separate graph, we draw a graph of the algebraic (i.e. I carry out summation of gradients taking into account their signs (+/-)) sum of gradients of ball potential with respect to the parabola line constructed for the current sample. For simplicity of understanding I can say that absolutely the same approach is used here which is used for determination of Hurst coefficient with the difference that instead of approximating linear regression channel a parabola (quadratic function) is taken, and also parabola itself is constructed for all current sample, including calculated bar for which the potential gradient is searched. Just in case, let me remind you that in order to find the Hurst coefficient we took a sample that does not include the current bar.
The blue vertical line indicates the local minimum for the algebraic sum of the potential gradients for the channel starting at this very bar. If you look carefully at the EURUSD and USDCHF charts, you can see that the local lows exactly (+/-1 bar) coincide with the local maximums/minimums of price. I attribute the error of 1 bar to the peculiarities of sample preparation. I choose (O+H+L+C)/4 bar values as a sample. Probably, in this case we should selectively choose either High or Low that would definitely eliminate an error of determining the channel with the minimum potential energy. And then the channels in the series will coincide exactly with those shown in the picture shown earlier by Vladislav for USDCHF. Well, I will try to implement this assumption in my EA. I think it is really close to the method of channel selection used by Vladislav and shared by him.

PS: The graph shows the algebraic sum of gradients module (for clarity). To calculate the gradient potential on the current bar, build a parabola for the sample from the beginning of the channel to the current bar, including the calculated bar itself. I.e. if you select 100 bars, you need to calculate 97 parabolas, because to build a parabola using the ANC method you must have at least 4 samples (I found this out experimentally today ;o)). Accordingly I simply take the gradient of potential on first 3 bars to be equal to zero. Rosh, I think here you will be free to optimize computational algorithms, because calculation of a parabola takes some times more time than the calculation of a linear regression channel ;o))).
 
А вот и новый сюрприз - рисование стрелочек не меняет времени прогона, это интересно.

I have this effect, depending on how I run the algorithm discussed here, the execution time is either 0 or 16 ms. I assume that in some cases algorithm is executed continuously, and in some cases it is interrupted and full terminal cycle is executed (because numbers are repeated steadily). By analogy - can't the drawing take place after the end of calculations?



In this link - " MQL4, MQL2, EasyLanguage, Wealth-Lab 3.0 and VC++: Speed Comparison" - Renat wrote


Renat 14.01.05 14:18

Simply, I faced with inadequate behavior of GetTickCount() more than once; although, if results of many measurements were stable +/- some small delta, it confirms fidelity of tests.


Yes, the accuracy of GetTickCount() jumps from 10 to 16 ms and we cannot measure small periods with it, but in our case its use is reasonable. Especially when it is so easily accessible from almost any code.