Can help to fix to Show the resuld in CY and CZ, red word don't know to set, Thanks a lot

 
#property link      ""
#property indicator_separate_window
#property strict
#property indicator_buffers 105
#property indicator_plots 105
#property indicator_color44  clrRed
#property indicator_type44   DRAW_LINE
#property indicator_width44  1
#property indicator_color45  clrOrange
#property indicator_type45   DRAW_LINE
#property indicator_width45  1
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
extern int iP  = 5; //Period(5)
extern int iYp = 1;//Y period
extern int iZp = 1; //Z period
double A[];
double B[];
double C[];
double D[];
double E[];
double F[];
double G[];
double H[];
double I[];
double J[];
double K[];
double L[];
double M[];
double N[];
double O[];
double P[];
double Q[];
double R[];
double S[];
double T[];
double U[];
double V[];
double W[];
double X[];
double Y[];
double Z[];
double AA[];
double AB[];
double AC[];
double AD[];
double AE[];
double AF[];
double AG[];
double AH[];
double AI[];
double AJ[];
double AK[];
double AL[];
double AM[];
double AN[];
double AO[];
double AP[];
double AQ[];
double AR[];
double AS[];
double AT[];
double AU[];
double AV[];
double AW[];
double AX[];
double AY[];
double AZ[];
double BA[];
double BB[];
double BC[];
double BD[];
double BE[];
double BF[];
double BG[];
double BH[];
double BI[];
double BJ[];
double BK[];
double BL[];
double BM[];
double BN[];
double BO[];
double BP[];
double BQ[];
double BR[];
double BS[];
double BT[];
double BU[];
double BV[];
double BW[];
double BX[];
double BY[];
double BZ[];
double CA[];
double CB[];
double CC[];
double CD[];
double CE[];
double CF[];
double CG[];
double CH[];
double CI[];
double CJ[];
double CK[];
double CL[];
double CM[];
double CN[];
double CO[];
double CP[];
double CQ[];
double CR[];
double CS[];
double CT[];
double CU[];
double CV[];
double CW[];
double CX[];
double CY[];
double CZ[];
#define INDICATOR_EXTRA INDICATOR_DATA
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   int buffer=0;
   SetIndexBuffer(buffer++,A, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,B, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,C, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,D, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,E, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,F, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,G, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,H, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,I, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,J, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,K, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,L, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,M, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,N, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,O, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,P, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,Q, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,R, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,S, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,T, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,U, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,V, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,W, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,X, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,Y, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,Z, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AA, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AB, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AC, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AD, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AE, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AF, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AG, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AH, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AI, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AJ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AK, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AL, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AM, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AN, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AO, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AP, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AQ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AR, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AS, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AT, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AU, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AV, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AW, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AX, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AY, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,AZ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BA, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BB, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BC, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BD, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BE, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BF, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BG, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BH, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BI, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BJ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BK, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BL, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BM, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BN, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BO, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BP, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BQ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BR, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BS, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BT, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BU, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BV, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BW, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BX, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BY, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,BZ, INDICATOR_EXTRA);   
   SetIndexBuffer(buffer++,CA, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CB, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CC, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CD, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CE, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CF, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CG, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CH, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CI, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CJ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CK, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CL, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CM, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CN, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CO, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CP, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CQ, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CR, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CS, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CT, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CU, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CV, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CW, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CX, INDICATOR_EXTRA);
   SetIndexBuffer(buffer++,CY,  INDICATOR_DATA);
   SetIndexBuffer(buffer++,CZ, INDICATOR_DATA);   
   iP = fmax(iP,2);
   iYp = fmax(iYp,2);
   iZp = fmax(iZp,2);
   int i;
   //SetIndexLabel(0, "CY");
   //SetIndexLabel(1, "CZ");
   for (i=0; i<26; i++)
      SetIndexLabel(i, CharToString(uchar('A'+ i)));
   for (i=26; i<46; i++)
      SetIndexLabel(i, "A"+CharToString(uchar('A'+ i-26)));
   for (i=0; i<26; i++)
      SetIndexStyle(i, DRAW_NONE);
   SetLevelValue(0,0);
   return(0);
}
//+------------------------------------------------------------------+
//| 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[])
{
   int limit=0;
   if(prev_calculated==0)
      limit = rates_total-1;
   else
      limit = rates_total-prev_calculated;
   PrintText("A", "A", 100, 70, clrRed,18);
   PrintText("B", "B", 200, 70, clrRed,18);
   PrintText("C", "C", 300, 70, clrRed,18);
   PrintText("D", "D", 400, 70, clrRed,18);
   PrintText("E", "E", 500, 70, clrRed,18);
   int startY=120;
   for(int p=1; p<=5; p++)
   {
      PrintText("Open"+(string)p, DoubleToString(open[p], Digits), 100, startY, clrYellow,12);
      PrintText("High"+(string)p, DoubleToString(high[p], Digits), 200, startY, clrYellow,12);
      PrintText("Low"+(string)p, DoubleToString(low[p], Digits), 300, startY, clrYellow,12);
      PrintText("Close"+(string)p, DoubleToString(close[p], Digits), 400, startY, clrYellow,12);
      if(open[p]==high[p] && high[p]==low[p] && low[p]==close[p])
      {
         PrintText("E"+(string)p, "0", 500, startY, clrYellow,12);
      }
      else
      {
         PrintText("E"+(string)p, "0", 500, startY, clrYellow,12);
      }
      startY=startY+20;
   }
//---
   for(int i=limit; i>=0; i--)
   {
      C[i] = open[i];
      D[i] = high[i];
      E[i] = low[i];
      F[i] = close[i];
      G[i] = (double)Volume[i];
      //---
H[i] = (C[i]+D[i]+E[i]+F[i]+F[i])/5.0;
       I[i] = H[ArrayMaximum(H,17,i)];
       J[i] = H[ArrayMinimum(H,17,i)];
      CY[i] = H[i];
CZ[i]=(I[i]+J[i])/2;
      //---
//      Y[i] = CY[i];
//      for(int k=1; k<iYp; k++)
//         Y[i]+=CY[i+k];
//      Y[i]/=iYp;
//
//      //---
//      Z[i] = CZ[i];
//      for(int k=1; k<iZp; k++)
//         Z[i]+=CZ[i+k];
//      Z[i]/=iZp;
   }
//---
   return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PrintText(string object, string text, int x, int y, color clr,int size)
{
   ObjectCreate(object, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(object, text,size, "Futura Md BT", clr);
   ObjectSet(object, OBJPROP_CORNER, 0);
   ObjectSet(object, OBJPROP_ANCHOR, ANCHOR_CENTER);
   ObjectSet(object, OBJPROP_XDISTANCE, x);
   ObjectSet(object, OBJPROP_YDISTANCE, y);
}
//+------------------------------------------------------------------+
 
Your topic has been moved to the section: Technical Indicators
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
MQL5 forum: Technical Indicators
MQL5 forum: Technical Indicators
  • www.mql5.com
Questions about the development of technical indicators in the MQL5 language