How to calculate the Lowest Low of EMA ?

 

Hi, hope you can help me on this.

Is there a function that calculates the Lowest Low of a EMA (exponential moving average) for X number of periods ?

EMA30 = iMA(Symbol(), 0, 30, 0, MODE_EMA, PRICE_CLOSE, 1);

For Price I can with: Low[iLowest(NULL,0,MODE_LOW,5,1)] . Any similar formula for EMA ?

Thanks so much.

 
Sorry I meant the lowest Close :)
 
Store it into Array and use ArrayMinimum
 
jfortes:

Hi, hope you can help me on this.

Is there a function that calculates the Lowest Low of a EMA (exponential moving average) for X number of periods ?

EMA30 = iMA(Symbol(), 0, 30, 0, MODE_EMA, PRICE_CLOSE, 1);

For Price I can with: Low[iLowest(NULL,0,MODE_LOW,5,1)] . Any similar formula for EMA ?

Thanks so much.


I guess this is what the iLowest function does :

int X=30; //your number of bars
double lowestEma= iMA(Symbol(), 0, 30, 0, MODE_EMA, PRICE_CLOSE, 0);
for(int i=1;i<X;i++)
   {
    double Ema=iMA(Symbol(), 0, 30, 0, MODE_EMA, PRICE_CLOSE, i);
    if(Ema>=lowestEma)continue;
    lowestEma=Ema;
   }   

Start from current bar EMA value and compare with the next one. If it's lower, keep that value and continue comparing . That's it.

Hope it helps

 
qjol: Store it into Array and use ArrayMinimum
int X=30; //your number of bars
double emas[]; ArrayResize(emas,X);
for(int i=0; i<X;i++) emas[i] = iMA(Symbol(), 0, 30, 0, MODE_EMA, PRICE_CLOSE, i);
int iLow = ArrayMinimum(emas);
double lowestEma=emas[iLow];