code for EMA 14 in ATR 14 window

To add comments, please log in or register
Hefajatur Rahman
1027
Hefajatur Rahman  

how,

i m trying to code EMA 14 to show in ATR 14 chart window

i can do it in terminal by selecting moving leverage "Previous indicator DATA" 

but how can i code it for my EA


#define EMAperiodATR 14
int start(){
    static datetime Time0;  bool    newBar  = Time0 < Time[0];
    if (newBar){                              Time0 = Time[0];
        double EMAalphaATR = 2.0/(EMAperiodATR+1),
               ATR         = iATR(NULL, 0, ATR.Period, 1);
        static double EMA.ATR;
        EMA.ATR += (ATR - EMA.ATR) * EMAalphaATR;
    }

i got this code but showing some error


any help please

Files:
William Roeder
19628
William Roeder  
Hefajatur Rahman: but showing some error
ATR         = iATR(NULL, 0, ATR.Period, 1);
  1. Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. You can't use periods in variable names since Build 600 and Higher. 2014.02.03
To add comments, please log in or register