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

 
Dmitry Fedoseev:
Or EMA
Yeah I got it mixed up with LWMA, just for SMMA and EMA its previous values are relevant.
 
Sergey Efimenko:
Yep, I mixed it up with LWMA. Just for SMMA and EMA its previous values are relevant.

Sergey, you can't see in the code that LWMA method is used or desire to criticize everything you can blind your eyes like that miracle...

Can't you recompile with other methods yourself? That's why I had no desire to continue the subject by posting code.

Based on your message...

Sergey Efimenko:
Now compare results of your code and original one in mode of smoothing LWMA or SMMA and get different values because these two types of smoothing use their own previous values and using each time only N elements of period you loose these data. Besides I need different calculation periods for iBands and iMA, so I need 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. Conclusions.

I checked with LWMA...

At this point I'm leaving this branch. Go ahead and do it yourselves together with Dmitry.

 
Alexey Viktorov:

Sergey, you can't see in the code that LWMA method is used or desire to criticize everything you can blind your eyes like that miracle...

Can't you recompile with other methods yourself? That's why I had no desire to continue the subject by posting code.

Based on your message...

I tested it on LWMA...

At this point I will leave this thread. Go ahead and do it yourself with Dimitri.

When I wrote my second sample I mixed up EMA and LWMA. You should have tried it with EMA or, better yet, SMMA, to avoid such insults. Besides, I already explained a few times, why the data won't fit in this kind of smoothing, and naturally I suggested you also try it with SMMA or EMA, so you can see and understand what's the catch when using an additional array, not only you need to copy it every time, you also need to consider "complexities" (features) of some kinds (methods) of smoothing results.

In general the topic is not aimed at anyone's personalities, but at understanding the process of data smoothing and with the direction of array indexing for everyone, maybe someone will discover new horizons.