EA MT4 - Moving average on momentum

To add comments, please log in or register
vazsier
12
vazsier  

Hi guys,

I'm trying to calculate a moving average over momentum indicator but EA crash at the boot of the back test because of the buffer I think ... someone has a better idea how to solve this ... I'm trying to calculate the moving average in the wrong way i think...


//--- Get MOMENTUM and MA_Momentum
double   momentum_val = iMomentum(NULL,0,10,PRICE_WEIGHTED,0);
double   momentum_array[];

for(int i = 13; i >= 0; i--)
{
   momentum_array[i] = iMomentum(NULL,0,10,PRICE_WEIGHTED,i);    
}

double   ma_moment_val = iMAOnArray(momentum_array,0,14,0,MODE_SMA,0);

tx a lot

Konstantin Nikitin
7859
Konstantin Nikitin  
double    momentum_array[14];

Or

double    momentum_array[];
if( ArrayResize(momentum_array, 14) < 14 )
          return;
vazsier
12
vazsier  
Konstantin Nikitin:

Or

wow.... just it:

double    momentum_array[14];

tx a lot guy

Konstantin Nikitin
7859
Konstantin Nikitin  
vazsier:

wow.... just it:

double    momentum_array[14];

tx a lot guy

Yes, looked. But the meaning itself, think, is understandable

To add comments, please log in or register