in MT4 we have the iMAOnArray functions for easily smoothing an array with a moving average.
an example is shown from the STIX indicator:
What is the simplest equivalent of iMAOnArray in MQL5? it seems there is no comparable function although I have to be honest, it's giving me a headache trying to get my head around the new language.
does anybody have a similar function that i can learn from?
an example is shown from the STIX indicator:
Inserted Code
for( shift=limit; shift>=0; shift--)
{
double bull=0, bear=0;
for (i=0;i<=Length-1;i++)
{
if(Close[shift+i]>Close[shift+i+1]) bull += 1;
if(Close[shift+i]<Close[shift+i+1]) bear += 1;
}
if(bull+bear != 0) STIX[shift] = 100*bull/(bull+bear);
}
for( shift=limit; shift>=0; shift--)
AvgSTIX[shift]=iMAOnArray(STIX,0,Smooth,0,ModeMA,shift); What is the simplest equivalent of iMAOnArray in MQL5? it seems there is no comparable function although I have to be honest, it's giving me a headache trying to get my head around the new language.
does anybody have a similar function that i can learn from?