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

 
Sergey Efimenko:
Was I supposed to guess there's a different code? Above screenshot also, where last 100 bars were counted, but in fact all bars were counted, but only 100 were copied to the buffer. Yes and why not post the code at once? There wouldn't have been such an answer. I would have answered substantively, I don't understand what's the point? You can immediately see from the code what's going on, what counts and whether there are the above flaws. And what does the screen give you? Nothing but the result, and about the result already said, it can be reached in different ways, but not all of them are acceptable for the task at hand - to reduce the calculation time.

Convincing. Must have been the amount taken before... I'm sorry.

 int i, limit;
   limit = prev_calculated == 0 ? rates_total-1 : rates_total-prev_calculated;
   double buffer[];                   // это промежуточный буфер для расчёта
    ArraySetAsSeries(buffer, true);   // это сам знаешь

   for(i = limit; i >= 0; i--)
     {
      Buffer[i]=open[i];             // в комментарии не нуждается
      
       BufferBMA[i] = NormalizeDouble(iMAOnArray(Buffer, 0, 5, 0, MODE_LWMA, i), _Digits); // Я воспользовался этим буфером чтобы не описывать ещё один
      
     if(rates_total-i >= rates_total-50)   // Всё основное действо...
      {
       ArrayCopy(buffer, Buffer, 0, i, 5);  // Копируем в дополнительный буфер часть основного 
       BufferMA[i] = NormalizeDouble(iMAOnArray(buffer, 0, 5, 0, MODE_LWMA, 0), _Digits);  // и вычисляем среднее значение с указанным периодом
      }
     }
return(rates_total);

The result is in the screenshot above.

 
Alexey Viktorov:

Convincing. Must have been the amount taken before... I'm sorry.

The result is in the screenshot above.

How much of this nonsense can you say?
 
Dmitry Fedoseev:
How much of this nonsense can you spout?
I've answered before.

Alexey Viktorov:

You're the only one who can start a fistfight. Count how many forum members you interacted with in this tone of voice like that with me now. Go away, Satan.

 
Alexey Viktorov:
Answered earlier.
So how much of this nonsense can you spout? What are you trying to prove?
 
Dmitry Fedoseev:
How much of this nonsense can you spout? What are you trying to prove?
Nothing to you.
 
Alexey Viktorov:
Nothing for you.
And to whom and what?
 
Dmitry Fedoseev:
And for whom and what?
For my own sake, I am having fun. So my brain doesn't dry out, and at the same time people might benefit. All you do is shit... Go away, Satan...
 
Alexey Viktorov:
For my own amusement. To keep my brain from drying out, and at the same time, maybe people will benefit. All you do is shit... Be gone, Satan...
Then you've got the wrong place for entertainment.
 
Alexey Viktorov:

Convincing. Must have been the amount taken before... I'm sorry.

The result is in the screenshot above.

Try setting SMMA mode :) But even without it, there is still excessive copying of the array, and if you multiply the calculations by every tick, especially as the smoothing period grows, the array will grow too.
 
Sergey Efimenko:
Try SMMA mode :)
Or EMA