ArrayResize(SMA,limit); //--- Размер различный задавал от 1 до Bars ArrayInitialize(SMA,0);
for(i=0;i<limit;i++){// bla bla bla
SMA[i]=...........; // --- Заполнение массива.
MA1[i]=iMAOnArray(SMA,0,8,0,0,0); //----MA1 буферный.
In order to get one value of average you need to analyse period of input data, so size of initial array SMA[] should not be less than limit+period - so I made a mistake here ArrayRezize(SMA,limit+period); you do not need to initialize, anyway you will not go further than necessary.
I usually do this with a non-buffered one.
how the indicator in the cycle defines the start of a new day, I have it like this:
does anyone have a better design than this?Hello! My goal is to transfer the indicator by creating a function into the EA.
The first step, which is the creation of the function, is done. But the next one - testing - does not work.
The indicator draws channels. It has 4 buffers and a lot of variables. I have placed it all in the function.
But when creating a test Expert Advisor to make sure that it works exactly by comparing the indicator and my function, I cannot achieve compilation.
Constant errors of external variables, which were not there when I created the function, have popped up in the EA.
Please give me some advice or a link to an example. I have used GODZILLA's articles, but his examples are different from mine.