Download MetaTrader 5
To add comments, please log in or register
Do you want to deposit to your account? Do this in any convenient way!
John
79
John 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.

John
79
John 2014.04.03 16:42  
Sorry I meant the lowest Close :)
qjol
3243
qjol 2014.04.03 17:03  
Store it into Array and use ArrayMinimum
Daniel Petrovai
440
Daniel Petrovai 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

whroeder1
13593
whroeder1 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];
/
To add comments, please log in or register