int handleEMA = iMA(_Symbol,PERIOD_CURRENT,30,0,MODE_EMA,haArray[1]);
CopyBuffer(handleEMA,0,1,5,emaArray);
But in Metatrader 5 I'm getting different results compared to the TradingView. I think I did the first and third step right. But I have doubts on how I wrote ha_close = security(ha, res, close[1]) in MQL5. Need help :(
The Heiken-Ashi indicator is looks like the candlestick chart, but it has some difference.The advantage of the Heiken-Ashi charts is a simple trend determination, the upward trend candles are blue,the downward trend candles are red.
The pinescript code is like the following
I'm trying to use the above code in MetaTrader5.
So I tried the following,
[ Using https://www.mql5.com/en/code/33 for getting Heikin Ashi values ]
Then I got the CLOSE buffer value, Which is at the 4th position,
And then I got the EMA of those CLOSE values,
But in Metatrader 5 I'm getting different results compared to the TradingView. I think I did the first and third step right. But I have doubts on how I wrote ha_close = security(ha, res, close[1]) in MQL5. Need help :(