Hi, I'm a beginner for mq4 programming.
I would like help in programming a function that is the average of an average.
Knowing the EMA, how to program the EMA1 = f (EMA).
EMA = (period 12, exponential, price close)
EMA1 = (period 5, exponential, EMA).
Thanks to those who can help me.
#define EMA(P,C,L) ((P) + ((C)-(P))*2./(L+1))
static double value=0, ema1=0, ema2=0;
double Vp = value; value = …;
double ema1p = ema1; ema1 = EMA(Vp, value, Length);
double ema2p = ema2; ema2 = EMA(ema1p, ema2p, Length);