"SetIndexBuffer" Help with my conversion from mql4 to mql5

//+------------------------------------------------------------------+
//|                                                 Megafx.mq5 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                                 https://mql5.com |
//+------------------------------------------------------------------+


#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Black
#property indicator_color2 Lime
#property indicator_color3 Red
#property indicator_color4 Yellow
#property indicator_color5 Lime
#property indicator_color6 Red


//:::::::::::::::::::::::::::::::::::::::::::::::

input bool ALERTS = true;
input bool SoundAlerts = true;
input string SoundAlertFile = "alert.wave";
input bool eMailAlerts = true;
int G_bars_96;
int Gi_100 = 21;
double G_ibuf_104[];
double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];
double G_ibuf_124[];

// E37F0136AA3FFAF149B351F6A4C948E9
int OnInit() {
  //:::::::::::::::::::::::::::::::::::::::::::::
  double Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
  double Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
  int Bars=Bars(Symbol(),PERIOD_CURRENT);
  double Point=Point();
  //Etc.
  //:::::::::::::::::::::::::::::::::::::::::::::::

   PlotIndexSetInteger(0,PLOT_DRAW_TYPE,NULL);
   PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(2,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(2,PLOT_LINE_WIDTH,3);
   PlotIndexSetInteger(3,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(3,PLOT_LINE_WIDTH,3);
   PlotIndexSetInteger(4,PLOT_ARROW,225);
   PlotIndexSetInteger(4,PLOT_ARROW_SHIFT,5);
   PlotIndexSetInteger(4,PLOT_COLOR_INDEXES,clrRed);
   PlotIndexSetInteger(5,PLOT_ARROW,226);
   PlotIndexSetInteger(5,PLOT_ARROW_SHIFT,5);
   PlotIndexSetInteger(5,PLOT_COLOR_INDEXES,clrLime);
   
   
   IndicatorSetInteger(INDICATOR_DIGITS,0)
   //--- indicator buffers mapping
   SetIndexBuffer(0, G_ibuf_104);
   SetIndexBuffer(1, G_ibuf_108);
   SetIndexBuffer(2, G_ibuf_112);
   SetIndexBuffer(3, G_ibuf_116);
   SetIndexBuffer(4, G_ibuf_120);
   SetIndexBuffer(5, G_ibuf_124);
   
   IndicatorSetString(INDICATOR_SHORTNAME,"MEGAFXPROFIT © www.megafxprofit.com");
  
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
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[]) {
  //:::::::::::::::::::::::::::::::::::::::::::::
  double Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
  double Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
  int Bars=Bars(Symbol(),PERIOD_CURRENT);
  double Point=Point();
  //Etc.
  //:::::::::::::::::::::::::::::::::::::::::::::::

   double Ld_0;
   double Ld_8;
   double Ld_16;
   string Ls_104;
   string Ls_112;
   string Ls_120;
   int Li_24 = Bars;
   double Ld_28 = 0;
   double Ld_36 = 0;
   double Ld_unused_44 = 0;
   double Ld_unused_52 = 0;
   double Ld_60 = 0;
   double Ld_unused_68 = 0;
   double low_76 = 0;
   double high_84 = 0;
   if (Li_24 > 0) Li_24--;
   int Li_92 = Bars - Li_24;
   for (int Li_96 = 0; Li_96 < Li_92; Li_96++) {
      high_84 = high[iHighest(NULL, 0, MODE_HIGH, Gi_100, Li_96)];
      low_76 = low[iLowest(NULL, 0, MODE_LOW, Gi_100, Li_96)];
      Ld_16 = (high[Li_96] + low[Li_96]) / 2.0;
      Ld_28 = 0.66 * ((Ld_16 - low_76) / (high_84 - low_76) - 0.5) + 0.67 * Ld_36;
      Ld_28 = MathMin(MathMax(Ld_28, -0.999), 0.999);
      G_ibuf_104[Li_96] = MathLog((Ld_28 + 1.0) / (1 - Ld_28)) / 2.0 + Ld_60 / 2.0;
      Ld_36 = Ld_28;
      Ld_60 = G_ibuf_104[Li_96];
   }
   bool Li_100 = true;
   for (int Li_96 = Li_92 - 2; Li_96 >= 0; Li_96--) {
      G_ibuf_116[Li_96] = 0;
      Ld_8 = G_ibuf_104[Li_96 + 1];
      Ld_0 = G_ibuf_104[Li_96 + 2];
      if ((Ld_8 < 0.0 && Ld_0 > 0.0) || Ld_8 < 0.0) {
         Li_100 = false;
         if (Ld_8 < 0.0 && Ld_0 > 0.0) {
            Ls_104 = Symbol() + ", TF:" + f0_0(Period());
            Ls_112 = Ls_104 + ", MEGAFXPROFIT SELL SIGNAL for Level: " + Ld_8;
            Ls_120 = Ls_112 + " @ " + TimeToString(TimeLocal(), TIME_SECONDS);
            if (Bars > G_bars_96) {
               G_bars_96 = Bars;
               f0_1(Ls_120, Ls_112);
            }
         }
      }
      if ((Ld_8 > 0.0 && Ld_0 < 0.0) || Ld_8 > 0.0) {
         Li_100 = true;
         if (Ld_8 > 0.0 && Ld_0 < 0.0) {
            Ls_104 = Symbol() + ", TF:" + f0_0(Period());
            Ls_112 = Ls_104 + ", MEGAFXPROFIT BUY SIGNAL for Level: " + Ld_8;
            Ls_120 = Ls_112 + " @ " + TimeToString(TimeLocal(), TIME_SECONDS);
            if (Bars > G_bars_96) {
               G_bars_96 = Bars;
               f0_1(Ls_120, Ls_112);
            }
         }
      }
      if (!Li_100) {
         G_ibuf_112[Li_96] = Ld_8;
         G_ibuf_108[Li_96] = 0.0;
      } else {
         G_ibuf_108[Li_96] = Ld_8;
         G_ibuf_112[Li_96] = 0.0;
      }
   }
   for (int Li_96 = 0; Li_96 < Li_92; Li_96++) {
      if (G_ibuf_108[Li_96] > 0.0 && G_ibuf_108[Li_96 + 1] == 0.0) G_ibuf_120[Li_96] = G_ibuf_108[Li_96];
      if (G_ibuf_112[Li_96] < 0.0 && G_ibuf_112[Li_96 + 1] == 0.0) G_ibuf_124[Li_96] = G_ibuf_112[Li_96];
   }
   return(rates_total);
}

// FF3DED0DF4360E36577F1A7C4D36796A
void f0_1(string As_0, string As_8) {
   if (ALERTS) Alert(As_0);
   if (SoundAlerts) PlaySound(SoundAlertFile);
   if (eMailAlerts) SendMail(As_8, As_0);
}

// A9BA851E539886467D4ECFDDCA93F414
string f0_0(int Ai_0) {
   switch (Ai_0) {
   case 1:
      return ("M1");
   case 5:
      return ("M5");
   case 15:
      return ("M15");
   case 30:
      return ("M30");
   case 60:
      return ("H1");
   case 240:
      return ("H4");
   case 1440:
      return ("D1");
   case 10080:
      return ("W1");
   case 43200:
      return ("MN1");
   }
   ChartRedraw();
   return PeriodSeconds(Period());
}