iHighest / iLowest Question

 
        double Hxval=High[iHighest(NULL,0,MODE_HIGH,14,0)];
        double Lxval=Low[iLowest(NULL,0,MODE_LOW,14,0)];
       
       
        double AVGX=(Hxval+Lxval)/2; 



  {
   ObjectDelete("UpSymbolAz"); ObjectDelete("DnSymbolAz"); WindowRedraw();
   

   CntBarsz = 70;
   
   int lowshiftz=iLowest(NULL,0,MODE_OPEN,CntBarsz,0);
    double Minimumz=Open[lowshiftz]; 
   datetime lowtimez=Time[lowshiftz];
                        
   int maxshiftz=iHighest(NULL,0,MODE_OPEN,CntBarsz,0);
    double Maximumz=Open[maxshiftz];  
   datetime maxtimez=Time[maxshiftz];
   
 

   for(i=0;i<CntBarsz-1;i++)                       
     {                                           
      if (Low[i]< Minimumz)                       
         {Minimumz=Low[i]; nz = i;  Alert("Low[i]= ",Low[i]);       
     
ObjectCreate("UpSymbolAz", OBJ_ARROW, 0, lowtimez,Minimumz);         
ObjectSet("UpSymbolAz", OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet("UpSymbolAz", OBJPROP_COLOR,White);
                 
      }
      
      
        {                  
         if (High[i]> Maximumz)                     
         {Maximumz=High[i]; mz = i;   Alert("High[i]= ",High[i]);          
         
      
ObjectCreate("DnSymbolAz", OBJ_ARROW, 0, maxtimez,Maximumz);                  
ObjectSet("DnSymbolAz", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
ObjectSet("DnSymbolAz", OBJPROP_COLOR,Yellow);        
         
     } } }

If I can count bars backwards to find the period which has the Highest or Lowest Open value. How can I find the value of a Moving Average at that point (period)? Do I need to create an array? The values of a MA are the current candle (period).

 
Yellowbeard: If I can count bars backwards to find the period which has the Highest or Lowest Open value. How can I find the value of a Moving Average at that point (period)?
  1. Can you count backwards ..?
  2. Once you find the bar shift pass it to iMA()
 
WHRoeder:
  1. Can you count backwards ..?
  2. Once you find the bar shift pass it to iMA()



Can't predict future. Can only go backwards.
 
You said "If I can count bars backwards." That left some doubt.