moving average over a custom indicator

 
hi, i've made a custom indicator, using rsi, stochastic, etc. and now i need to make a simple operation in other custom indicator, I need to take: "my custom indicator" -" moving average of that custom indicator"

I show you...

my first custom indicator, let's call Custom_A:

for(i=0; i<limit; i++) {

      Custom_A[i] = iRSI(NULL,0,Periodo,PRICE_CLOSE,i) + iMFI(NULL,0,Periodo,i);

      }


my second custom indicator, let's call Custom_B:

for(i=0; i<limit; i++) {

      Custom_B[i] = iCustom(NULL,0,"Custom_A",Period,0,i) - iMA(b5vg,0,Period,0,MODE_EMA,PRICE_CLOSE,i);

      }


but it doesn't works.

can you give me some help?

thanks
 

Combine the two indicators into a single CustomAB indicator would be my first thought as to a solution.

Second thought is you didn't supply any parameters for the first indicator in the iCustom() call.

 
yes, Period is the parameter in iCustom()

i'll try to combine the two indicators. how should i do?

thanks
 
CustomB[i] = iCustom(NULL,0,"Custom_A",Periodo,0,i);

this works, reads the Custom_A value, why 

Custom_B[i] = iCustom(NULL,0,"Custom_A",Period,0,i) - iMA(Custom_A,0,Period,0,MODE_EMA,PRICE_CLOSE,i

doesn't works?
 
should i use iMAOnArray? how?
Reason: