Ругается на переведенную функцию с mql4

 
При переводе с MQL4 на MQL5 iMACD да и любой другой функции ругается на 
return(CopyBufferMQL4(handle,mode,shift));

Мол CopyBufferMQL4 не определен. Подскажите как исправить пожалуйста

 

Пример получения данных с iMACD:

//+------------------------------------------------------------------+
//| Get value of buffers for the iMACD                               |
//|  the buffer numbers are the following:                           |
//|   0 - MAIN_LINE, 1 - SIGNAL_LINE                                 |
//+------------------------------------------------------------------+
double iMACDGet(const int buffer,const int index)
  {
   double MACD[1];
//--- reset error code 
   ResetLastError();
//--- fill a part of the iMACDBuffer array with values from the indicator buffer that has 0 index 
   if(CopyBuffer(handle_iMACD,buffer,index,1,MACD)<0)
     {
      //--- if the copying fails, tell the error code 
      PrintFormat("Failed to copy data from the iMACD indicator, error code %d",GetLastError());
      //--- quit with zero result - it means that the indicator is considered as not calculated 
      return(0.0);
     }
   return(MACD[0]);
  }


При этом нужно предварительно в советнике, в OnInit() поучить хендл индикатора iMACD:

//--- create handle of the indicator iMACD
   handle_iMACD=iMACD(m_symbol.Name(),Period(),2,4,1,PRICE_CLOSE);
//--- if the handle is not created 
   if(handle_iMACD==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code 
      PrintFormat("Failed to create handle of the iMACD indicator for the symbol %s/%s, error code %d",
                  m_symbol.Name(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early 
      return(INIT_FAILED);
     }

ds

 

Пример советника, который использует iMACD и iCCI.

MACDCCI
MACDCCI
  • голосов: 20
  • 2016.12.06
  • Vladimir Karputov
  • www.mql5.com
Работа по двум индикаторам: iCCI (Commodity Channel Index, CCI) и iMACD (Moving Average Convergence/Divergence, MACD). OnTradeTransaction().  Так как у индикаторов CCI и MACD разная шкала измерений, то был ведён переводной коэффициент: Согласование показаний осуществляется здесь: ()   {    cci=iCCIGet(back);   ...
 
miron_like:
При переводе с MQL4 на MQL5 iMACD да и любой другой функции ругается на 

Мол CopyBufferMQL4 не определен. Подскажите как исправить пожалуйста


Так опишите функцию. Она ведь не штатная, а пользовательская. Взяли ее из статьи. Значит оттуда и скопируйте.

Причина обращения: