EMA in first indicator data. by code how is possible do that

 

Good morning, I have an EA code that is giving me problems. I would like to replicate in code when I apply a 7-period SMA moving average on the 14-period RSI indicator and I tell it “first indicator data.” I thought it would be enough to take the RSI values and calculate a moving average on those, but it doesn’t add up. Is there a faster way to do this?

Below are some pieces of code — I’m not attaching everything because the program is very long. I just want to understand if there are any errors or, if possible, if you have a simple example to illustrate this. Thanks!


double CalculateSMA(double &values[], int count) {
   if(count == 0) return 0.0;
   double sum = 0;
   for(int i=0; i<count; i++)
      sum += values[i];
   return sum / count;
}

      double rsiArr[14];
            if(CopyBuffer(rsiHandles[sym][tf], 0, 0, 14, rsiArr) <= 0) continue;

            double rsiValue = rsiArr[0];
            double rsiSMA7 = CalculateSMA(rsiArr, 7);


 
Stefano Cerbioni:

Good morning, I have an EA code that is giving me problems. I would like to replicate in code when I apply a 7-period SMA moving average on the 14-period RSI indicator and I tell it “first indicator data.” I thought it would be enough to take the RSI values and calculate a moving average on those, but it doesn’t add up. Is there a faster way to do this?

Below are some pieces of code — I’m not attaching everything because the program is very long. I just want to understand if there are any errors or, if possible, if you have a simple example to illustrate this. Thanks!


that is typicaly called a qqe indicator. search codebase. There is many examples and "flavours" to explore and experiment with -- already made.

 
sorry but I did not understand what he hits with the question I asked
 
Stefano Cerbioni #:
sorry but I did not understand what he hits with the question I asked

look in codebase, as i said there is several indicators with ma applied over top of rsi, as you asked about. I wont post a search page link as you have been on this site long enuf to know where to find it.

 
Stefano Cerbioni #:
sorry but I did not understand what he hits with the question I asked

i have 4 different qqe indicators, which 1 line is rsi, other is ema, and i can change the settings so that it looks 100% same as if i had just placed a ma on rsi on my chart. All of them from codebase.