erro no código, alguém poderia me ajudar a concerta ?

 
//+------------------------------------------------------------------+
//|                                                     ZigZag MA    |
//|                                                      mql5 version |
//|                                                          xrepetto |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 Yellow
#property indicator_color3 LimeGreen

//---- input parameters
input int period_ma = 200;

//---- buffers
double zzHighBuffer[];
double zzLowBuffer[];
datetime zzTimeBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   //---- indicator buffers mapping
   SetIndexBuffer(0, zzHighBuffer, INDICATOR_DATA);
   SetIndexBuffer(1, zzLowBuffer, INDICATOR_DATA);
   SetIndexBuffer(2, zzTimeBuffer, INDICATOR_DATA);

   //---- indicator colors
   SetIndexStyle(0, DRAW_ARROW, 0, 3);
   SetIndexArrow(0, 233);
   SetIndexStyle(1, DRAW_ARROW, 0, 3);
   SetIndexArrow(1, 234);
   SetIndexStyle(2, DRAW_NONE);

   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[],
                 const double &open[], const double &high[], const double &low[], const double &close[],
                 const long &tick_volume[], const long &volume[], const int &spread[])
{
   //---- variables
   int limit;
   double ma;
   double last_high = 0, last_low = 0;
   bool buy_signal = false, sell_signal = false;

   //---- indicator buffers
   ArrayInitialize(zzHighBuffer, 0.0);
   ArrayInitialize(zzLowBuffer, 0.0);
   ArrayInitialize(zzTimeBuffer, 0);

   //---- get handle of the ZigZag indicator
   int zzHandle = iCustom(NULL, 0, "ZigZag");

   //---- calculate moving average
   ma = iMA(NULL, 0, period_ma, 0, MODE_SMA, PRICE_CLOSE);

   //---- find last high and low from ZigZag indicator
   int zzShift = 0;
   while (zzShift >= 0)
   {
      if (iCustom(NULL, 0, "ZigZag", 0, 0, zzShift) > 0)
      {
         last_high = iCustom(NULL, 0, "ZigZag", 0, 0, zzShift);
         break;
      }
      zzShift--;
   }
   zzShift = 0;
   while (zzShift >= 0)
   {
      if (iCustom(NULL, 0, "ZigZag", 0, 1, zzShift) > 0)
      {
         last_low = iCustom(NULL, 0, "ZigZag", 0, 1, zzShift);
         break;
      }
      zzShift--;
   }

   //---- main loop
   limit = rates_total - 1;
   for (int i = limit; i >= 0; i--)
   {
      //---- get ZigZag indicator data
      CopyBuffer(zzHandle, 0, i, 1, zzHighBuffer);
      Copy


essa acima é o código e os erros são esses a baixo

"';' - unexpected end of program" "'{' - unbalanced parentheses" "OnCalculate function not found in custom indicator" "'SetIndexBuffer' - no one of the overloads can be applied to the function call"


gostaria de ajuda... meta treder 4

Documentação sobre MQL5: Funções para Array / ArrayInitialize
Documentação sobre MQL5: Funções para Array / ArrayInitialize
  • www.mql5.com
ArrayInitialize - Funções para Array - Referência MQL5 - Referência sobre algorítimo/automatização de negociação na linguagem para MetaTrader 5
 

Utilize o botão "</>" (Alt-S) para inserir o seu código correctamente

Code button in editor


O seu código está incompleto. Será que foi gerado pelo ChatGPT? Se sim, então pare de utilizar o ChatGPT e contrate um programador humano.