coding moving average over other indicator

 
hi

in mt4 terminal, i know that we can use moving average over other indicator by select apply to previous or first indicator.

if i am writing my own indicator or EA, and would like to do the same, how should the code be please?
 
luckyvictor:
hi

in mt4 terminal, i know that we can use moving average over other indicator by select apply to previous or first indicator.

if i am writing my own indicator or EA, and would like to do the same, how should the code be please?
You can collect the values of any other indicator in an array and then use function iMaOnArray.
Reason: