Using indicators in MQL5 seems really complicated compared to MQL4, what am I doing wrong?

 
So recently I've been playing around with MT5 and MQL5, before that I wrote some very basic MT4 EAs, but never tried writing one for MT5. The first thing I've noticed is how complicated everything seems, as an example in MQL4 in order to save RSI indicator data to a variable only one simple line of code is required:

 

double myRSI = iRSI(NULL,0,14,PRICE_CLOSE,0);  

 But from what I understand so far with MQL5 I need to write multiple lines of code to achieve the same task. Most tutorials I found so far talk about creating an indicator handle, then using ArraySetAsSeries() function and CopyBuffer() after that and sometimes a few other things in between.

 

Is there a way to use builtin MT5 indicators in MQL5 in a way that is as simple as it was in MQL4?

 
liberssky: So recently I've been playing around with MT5 and MQL5, before that I wrote some very basic MT4 EAs, but never tried writing one for MT5. The first thing I've noticed is how complicated everything seems, as an example in MQL4 in order to save RSI indicator data to a variable only one simple line of code is required:

double myRSI = iRSI(NULL,0,14,PRICE_CLOSE,0);  

But from what I understand so far with MQL5 I need to write multiple lines of code to achieve the same task. Most tutorials I found so far talk about creating an indicator handle, then using ArraySetAsSeries() function and CopyBuffer() after that and sometimes a few other things in between.

Is there a way to use builtin MT5 indicators in MQL5 in a way that is as simple as it was in MQL4?


Quote from Migrating from MQL4 to MQL5 (read entire Article for more information):
double iRSI(string symbol,
            int timeframe,
            int period,
            int applied_price,
            int shift)
double iRSIMQL4(string symbol,
                int tf,
                int period,
                int price,
                int shift)
  {
   ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
   ENUM_APPLIED_PRICE applied_price=PriceMigrate(price);
   int handle=iRSI(symbol,timeframe,period,applied_price);
   if(handle<0)
     {
      Print("The iRSI object is not created: Error",GetLastError());
      return(-1);
     }
   else
      return(CopyBufferMQL4(handle,0,shift));
  }
iRSI
Calculates the Relative strength index and returns its value.
iRSI

Also read the following:
iRSI - Technical Indicators - MQL4 Reference
iRSI - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iRSI - Technical Indicators - MQL4 Reference
 
This blogpost may probably help you - HashMap supports old-fashioned indicators in MetaTrader 5.
Reason: