In general, remove the call to this function from the loop. There is already a full loop in this function. In begin you need to pass the beginning of significant data in the array, based on which you are doing smoothing. For some types of smoothing you need a pre-calculation. For SMMA it is about two calculation periods.
In general, remove the call to this function from the loop. There is already a full loop in this function. In begin you need to pass the beginning of significant data in the array, based on which you are doing smoothing. For some types of smoothing you need a pre-calculation. For SMMA it is about two calculation periods.
But when a new bar is added, won't the entire array be recalculated? And when the current value in the array changes, the buffer would also need to be recalculated. In this case, how can we avoid the loop?
Once at the start of the indicator, through the entire buffer, and then only the last index on each tick? This is an impromptu. I haven't done so yet... I have to check it.
And in this case, when a new bar is added, won't the whole array be recalculated? And it wouldn't hurt to recalculate when the current value in the buffer array changes, either. In this case, how can we avoid the loop?
Once at the start of the indicator, through the entire buffer, and then only the last index on each tick? This is an impromptu. I haven't done so yet... I have to check it.
Well, look at the code - Vitaly has directly laid it out
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thank you!
Tried it and got an error, I'm doing something wrong:
Is buffer[] distributed? I see the declaration, but I don't see the size setting
Is buffer[] distributed? I see the declaration, but I don't see the size set
Set size, error somewhere else, doesn't work.
Set size, error somewhere else, doesn't work.
What are you transmitting?
What are you passing on?
Vitaly, why copy the function from the inluder? Wouldn't it be easier to plug in a library?
#include <MovingAverages.mqh>In general, remove the call to this function from the loop. There is already a full loop in this function. In begin you need to pass the beginning of significant data in the array, based on which you are doing smoothing. For some types of smoothing you need a pre-calculation. For SMMA it is about two calculation periods.
In general, remove the call to this function from the loop. There is already a full loop in this function. In begin you need to pass the beginning of significant data in the array, based on which you are doing smoothing. For some types of smoothing you need a pre-calculation. For SMMA it is about two calculation periods.
But when a new bar is added, won't the entire array be recalculated? And when the current value in the array changes, the buffer would also need to be recalculated. In this case, how can we avoid the loop?
Once at the start of the indicator, through the entire buffer, and then only the last index on each tick? This is an impromptu. I haven't done so yet... I have to check it.
And in this case, when a new bar is added, won't the whole array be recalculated? And it wouldn't hurt to recalculate when the current value in the buffer array changes, either. In this case, how can we avoid the loop?
Once at the start of the indicator, through the entire buffer, and then only the last index on each tick? This is an impromptu. I haven't done so yet... I have to check it.
Well, look at the code - Vitaly has directly laid it out
Well, look at the code - Vitaly posted it directly
Now I came to debug "SmoothedMAOnBuffer()" construct in mt4.
I don't understand what's wrong
Now I've come to debugging the "SmoothedMAOnBuffer()" construct in mt4.
What's wrong, I don't understand it at all