What's the most reliable solution for duplicating a MA on chart

 
Been attempting to convert this indicator from proRealTime to mql5 but running into issues with specifically duplicating the AMA to plot higher and lower. 

There is obviously a way to specify a price for the MA to be plotted but I can't figure out how exactly. The inputs are the same so it should be as simple as specifying the difference in x points between the middle MA and the high/low MA so what am I missing?
 
Monwabisi Balani: Been attempting

Show us your attempt (using the CODE button) and state the nature of your difficulty.
     How To Ask Questions The Smart Way. (2004)
          Prune pointless queries.

 
there's more than an ma going on there, it looks like it's measuring volatility with the ATR