Convert tradingview code to mql5

 
I try to add heiken Ashi price close handle in IMA. But i don't know how to do. For example like this :
ha = heikinashi(tickerid)
ha_close = security(ha, res, close[1])
ma = ema(ha_close[1], 30)

Thank you all.

 
Ludovic Duriez:
I try to add heiken Ashi price close handle in IMA. But i don't know how to do. For example like this :

Thank you all.

I don't think you can do this that simply. Because your code is trying to access previous close price in a heiken ashi chart(ha_close). And applying EMA formulation to ha_close shifted one bar( ha_close [1]) .

note: You are shifting twice. Is it really what you want?

Reason: