RSI and MA on RSI in ea

 

Hi 

I want to include a MA on the RSI into my ea without calling an custum indicator.

Is it possible to calculate the MA right in the expert advisor instead of calculation it in the indicator?


In the ea I want to include a check if MAonRSI crosses Value of RSI like this:

bool FilterRSIMACrossShort()

 

{

  double rsi0=iRSI(NULL,RSITimeframe,RSIPeriode,RSIPrice,0);

  double rsi1=iRSI(NULL,RSITimeframe,RSIPeriode,RSIPrice,1);

  double marsi0=iMA(NULL,MATimeframe,MAPeriod,0,MAMethod,MAPrice,MAShift);  //this uses MA on Price not on RSI

  double marsi1=iMA(NULL,MATimeframe,MAPeriod,0,MAMethod,MAPrice,MAShift+1);

   if(RSIMACrossFilteraktiv &&

       marsi1>rsi1 && marsi0 < rsi0)    //ma crosses

       return(true); else return(false); 

  }

                          

But iMA takes the MA of the price not of the RSI.

I read some comment, about using iMAOnArray, or ArraySetAsSeries ...

I tried a lot, but nothing worked. Was not able to compile without errors.


Has anyone an idea how to include without custom indicator? Thanks for your help.