# How to calculate the Lowest Low of EMA ?

80
2014.04.03 16:40

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.

80
2014.04.03 16:42
Sorry I meant the lowest Close :)
3243
2014.04.03 17:03
Store it into Array and use ArrayMinimum
440
2014.04.06 03:54
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

14737
2014.04.06 11:46
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];```