Help required with this normalize issue

 

Hello

I have an ea that uses Macd, Atr, Rsi etc.

Now for Atr I do this to return the correct value to the correct number if decimal spaces:

double Atr(int shift){

   double res;

   int theAtrPeriod;
   if(Period() >= PERIOD_M5 && Period() <= PERIOD_M30)
      theAtrPeriod = AtrPeriod2;
   if(Period() >= PERIOD_H1)
      theAtrPeriod = AtrPeriod3;
   if(Period() >= PERIOD_M1 && Period() < PERIOD_M5)
      theAtrPeriod = AtrPeriod;

    res = iATR(Symbol(),Period(),theAtrPeriod,shift)/1.0000000046511560159; //1.0000000046511560159; //1.000000004651156016; 
    
   if(Symbol()== "USDJPY"){return(NormalizeDouble(res,Digits-1));}
   if(Symbol()== "AUDJPY"){return(NormalizeDouble(res,Digits-1));}
   if(Symbol()== "CADJPY"){return(NormalizeDouble(res,Digits-1));}
   if(Symbol()== "CHFJPY"){return(NormalizeDouble(res,Digits-1));}
   if(Symbol()== "NZDJPY"){return(NormalizeDouble(res,Digits-1));}
   if(Symbol()== "ZARJPY"){return(NormalizeDouble(res,Digits-1));}
     
   else{
   return(NormalizeDouble(res,Digits));
   return(res);
  }
}

For Macd this:

double Macd(int shift,int mode=0){

   return(NormalizeDouble(iMACD (Symbol (), Period (), MacdFastPeriod, MacdSlowPeriod, MacdSignalPeriod, 0, mode, shift),Digits+1));  
}

Near the top of file are the condition statements with comments that show on the charts, for the MACD to be read correctly This is set as follows:

string d_str(double in){return(DoubleToStr(in,Digits+1));}

But this then upsets the rounding of the Atr, does anyone have any ideas? as I am fresh out.

Thanks

Antony

Reason: