Erro CopyBuffer do indicador iCustom

 

'CopyBuffer' - no one of the overloads can be applied to the function call

could be one of 3 function(s) huhu.mq5 71 4

   built-in: int CopyBuffer(int,int,int,int,double&[]) huhu.mq5 71 4

   built-in: int CopyBuffer(int,int,datetime,int,double&[]) huhu.mq5 71 4

   built-in: int CopyBuffer(int,int,datetime,datetime,double&[]) huhu.mq5 71 4


Olha não consigo achar o erro, ainda estou pesquisando, alguém já teve esse problema? 


//+------------------------------------------------------------------+
//|                                                    huhu.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int ZigZag_Handle; 
float ZigZag_List[];






int OnInit()
  {
//--- create handle of ZigZag indicator

   ZigZag_Handle = iCustom(_Symbol,_Period,"ZigZag.ex5",12,5,3); 
   ArraySetAsSeries(ZigZag_List,true); 
   
   if(ZigZag_Handle == INVALID_HANDLE) { 
      return(INIT_FAILED);
   }
   


  
  
//--- create timer
   EventSetTimer(300);

   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  
  //IndicatorRelease(ZigZag_Handle);
  
//--- destroy timer
   EventKillTimer();
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   
  
  
//---
   
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   CopyBuffer(ZigZag_Handle,2,0,4,ZigZag_List);
//---
   
  }
//+------------------------------------------------------------------+

 
Diego Wozniak:

...

tenta isso...


//+------------------------------------------------------------------+
//|                                                    50porcent.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int ZigZag_Handle; 
float ZigZag_List[];






int OnInit()
  {
//--- create handle of ZigZag indicator

   ZigZag_Handle = iCustom(_Symbol,_Period,"Examples\\ZigZag",12,5,3); 
   ArraySetAsSeries(ZigZag_List,true); 
   
   if(ZigZag_Handle == INVALID_HANDLE) { 
      return(INIT_FAILED);
   }
   


  
  
//--- create timer
   EventSetTimer(300);

   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  
  //IndicatorRelease(ZigZag_Handle);
  
//--- destroy timer
   EventKillTimer();
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   
  
  
//---
   
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
   Print(::CopyBuffer(ZigZag_Handle, 1, 2)); //High
   
  }
//+------------------------------------------------------------------+

double CopyBuffer(int handle, int current_buffer, int index)
  {
   static double values[];
   if(handle == INVALID_HANDLE)
      return EMPTY_VALUE;
   if(::CopyBuffer(handle, current_buffer, index, 1, values) == 0)
     {
      Print("Failed copy buffer of indicator. Last error: " + (string)GetLastError());
      return EMPTY_VALUE;
     }
   return values[0];
  }
 
Jonathan Pereira:

tenta isso...


Tu salvou o meu código, você é um anjo cara kkkkkk ainda to tentando entender o que você fez, meu nível nisso é muito baixo. 

Razão: