Function EMA on Array RSI?

 

Hello everybody,

I'm a newbie of mql4 and now I have a problem with iMA, iMaOnArry, RSI

I want to get the value of EMA( RSI(39),30) .

It means that it will caculate the EMA with period 30 of the Array RSI, the period of RSI is 39?

Can anyone help me this function

I have tried, but it was not working 

double EMA   (int i = 0)

{

double rsi[];

for (int k=Bars;k >= 0;k--)

rsi[k] = iRSI(NULL,0,39,PRICE_CLOSE,k);

return(iMAOnArray(rsi,0,30,0,MODE_EMA,i));

Reason: