MT4 iMAOnArray and iBandsOnArray effect of number of elements on calculations - page 4

 
Sergey Efimenko:
And this library calculates correctly, if we specify calculation not of the whole array, but only of its last part (current values)? Besides, this is only half of the problem, but what about iBandsOnArray?

There is a "begin" parameter there, try to limit it.

There was a time when theiMAOnArray functionwas very slow. Well, I had code that was optimized for about three hours usingiMAOnArray but then this function became sluggish and optimization took about 30 hours.

I don't know, maybe it was fixed now. But when I createdMovingAverages.mqh indicator thesame code was computed in about an hour and a half, i.e. the time was cut by half.

Ihave nothing to say about iBandsOnArray, I haven't seen such an includeable file with the same task in mql4.

 
With iBandsOnArray the indicator is slow on startup. Changed to iStdDevOnArray, it starts instantly.
 
Alexey Viktorov:

Here you go.

Yeah, well... Boy, go for a walk.
 
Dmitry Fedoseev:
With iBandsOnArray the indicator is slow on startup. Changed it to iStdDevOnArray, it starts instantly.
But in the tester it lags both withiBandsOnArray and iStdDevOnArray.
 
Dmitry Fedoseev:
Except that in the tester it lags withboth iBandsOnArray and iStdDevOnArray.
I used to think you were a good programmer. All you really can do is spread your fingers and argue. Don't you get any, that's why you're so angry?
 
Alexey Viktorov:

Here you go.

And now compare the result of your code and the original one in LWMA or SMMA straight line smoothing mode and get different values, because these two types of smoothing use their own previous values in their calculations, and using only N period elements each time you, respectively, lose this data, besides I eventually need different calculation periods for iBands and iMA, so I have to copy it twice. And the initial array for the calculation is used the same. The logic of your reasoning is clear to me, but it is wrong, because by reducing the length of the array, but at the same time doing each copy and recalculating all of its elements you finally increase the total time of the indicator calculation during optimization or work with several versions of the indicator for different TFs. In my case it slows down only the initial calculation, after that only 1 new element is calculated. The problem is in the implementation of these functions in MQL. Self-written versions work better and faster. Conclusions.
 
Dmitry Fedoseev:
Yeah, well... Boy, go for a walk.
That's not a boy, that's a very mature man. Although the habit of referring to everyone as "you" doesn't do him any justice, imho :)
 
Sergey Efimenko:
This is not a boy, but a very mature man. Although the habit of referring to everyone as "you" doesn't make him respectable, imho :)
Very mature how? A retired man in his dotage?
 
Sergey Efimenko:
And now compare the result of your code and the original one in LWMA or SMMA straight line smoothing mode and get different values, because these two types of smoothing use their own previous values in their calculations, and using only N period elements each time you, respectively, lose this data, besides I need different calculation periods for iBands and iMA, so I have to copy them twice. And the initial array for the calculation is used the same. The logic of your reasoning is clear to me, but it is wrong, because by reducing the length of the array, but at the same time doing each copy and recalculating all of its elements you finally increase the total time of the indicator calculation during optimization or work with several versions of the indicator for different TFs. In my case it slows down only the initial calculation, after that only 1 new element is calculated. The problem is in the implementation of these functions in MQL. Self-written versions work better and faster. Please draw your own conclusions.
Even though MODE_SMA is the same, I still shouldn't use it.
 
Alexey Viktorov:
I used to think you were a good programmer. The truth is, all you can do is spread your fingers and fight. You don't get any because you're so angry?
Well, dream on.
Reason: