Помогите с сопротивлением

 
Помогите переделать индикатор так чтобы он отрисовывал лини сопротивления на таймфреймах h4 и h1. на данный момент он расчитывает по d1 предыдущего дня на текущей день. а нужно сделать чтобы по d1 предыдущего на текущий но отображал на h4 в виде линий. Сам пробывал через iHigh но не получилось.
#property copyright "Cамоделкин"
#property link "1Vladimir_nvkz@mail.ru"
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Green 
//----
double ExtBlueBuffer[];
double ExtRedBuffer[];
double ExtLimeBuffer[];
double ExtgreenBuffer[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexShift(0,1);
   SetIndexShift(1,1);
   SetIndexShift(2,1);
   SetIndexShift(3,1);
//----
   SetIndexBuffer(0, ExtBlueBuffer);
   SetIndexBuffer(1, ExtRedBuffer);
   SetIndexBuffer(2, ExtLimeBuffer);
   SetIndexBuffer(3, ExtgreenBuffer);
//----
   SetIndexStyle(0, DRAW_ARROW );
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexStyle(2, DRAW_ARROW);
   SetIndexStyle(3, DRAW_ARROW);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {  
   for(int i=1; i<=3; i++)
     {
    
  
       ExtRedBuffer[i] = (((Low[i] + High[i] + Close[i]) / 3)*2 - Low[i]);
      
       ExtgreenBuffer[i] = (((Low[i] + High[i] + Close[i]) / 3)*2 - High[i]);
 
 
       ExtBlueBuffer[i] = (Low[i] + High[i] + Close[i]) / 3 - (((Low[i] + High[i] + 
                           Close[i]) / 3)*2 - High[i]) + (((Low[i] + High[i] + 
                           Close[i]) / 3)*2 - Low[i]); 
    
       ExtLimeBuffer[i] = (Low[i] + High[i] + Close[i]) / 3 + (((Low[i] + High[i] + 
                           Close[i]) / 3)*2 - High[i]) - (((Low[i] + High[i] + 
                           Close[i]) / 3)*2 - Low[i]);
    
     } 
   return(0);
  }
//+------------------------------------------------------------------+
 
Napishi pozhalusta kod gde Ti proboval s iHigh
 
Он у меня на другом компе, но принцип такой заменил все Low iLow(NULL,PERIOD_D1,i)
 
Когда увидел этот индикатор в базе, у меня возникло желание заменить Close[i] на Close[i+P1], а Low[i] и High[i] на Low[Lowest(NULL,0,MODE_LOW,P2,i+P1)] и High[Highest(NULL, 0,MODE_HIGH,P2,i+P1)], чтоб посмотреть не горизонтальные уровни, а ... что получится "в динамике" :). Что-то вроде:

#property copyright "Cамоделкин"
#property link "1Vladimir_nvkz@mail.ru"
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Green 
extern int    FilterPeriod =24; 
//----
double ExtBlueBuffer[];
double ExtRedBuffer[];
double ExtLimeBuffer[];
double ExtGreenBuffer[];
//+------------------------------------------------------------------+
int init()
  {
   SetIndexShift(0,1);
   SetIndexShift(1,1);
   SetIndexShift(2,1);
   SetIndexShift(3,1);
//----
   SetIndexBuffer(0, ExtBlueBuffer);
   SetIndexBuffer(1, ExtRedBuffer);
   SetIndexBuffer(2, ExtLimeBuffer);
   SetIndexBuffer(3, ExtGreenBuffer);
//----
   SetIndexStyle(0, DRAW_LINE );
   SetIndexStyle(1, DRAW_LINE);
   SetIndexStyle(2, DRAW_LINE);
   SetIndexStyle(3, DRAW_LINE);
//----
   return(0);
  }
//+------------------------------------------------------------------+
int start()
  {  
double h,l;
int i,j,limit,counted_bars=IndicatorCounted();
   if(counted_bars<0)  return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   if(limit>(Bars-FilterPeriod-1)) limit=Bars-FilterPeriod-1;
   for(i=limit;i>=0;i--) 
     {
       l=Low[Lowest(NULL,0,MODE_LOW,FilterPeriod,i+FilterPeriod)];
       h=High[Highest(NULL,0,MODE_HIGH,FilterPeriod,i+FilterPeriod)];
       ExtRedBuffer[i] = (((l+h+Close[i+FilterPeriod])/3)*2-l);
       ExtGreenBuffer[i] = (((l+h+Close[i+FilterPeriod])/3)*2-h);
       ExtBlueBuffer[i] = (l+h+Close[i+FilterPeriod])/3-
                        (((l+h+Close[i+FilterPeriod])/3)*2-h) + 
                        (((l+h+Close[i+FilterPeriod])/3)*2-l); 
       ExtLimeBuffer[i] = (l+h+Close[i+FilterPeriod])/3 +
                          (((l+h+Close[i+FilterPeriod])/3)*2-h) - 
                          (((l+h+Close[i+FilterPeriod])/3)*2-l); 
     } 
   return(0);
  }
//+------------------------------------------------------------------+
И погладить мувингами...
Причина обращения: