• Join us

I need help with "iBarShift" - page 2

To add comments, please log in or register
suzzy kerry
14
suzzy kerry  

for trading best strategy hit me up

Samih Abdelli
265
Samih Abdelli  

Hello

I found the solution if anyone wanted it

   int Counted_bars,i;
   Counted_bars=IndicatorCounted();
   i=Bars-Counted_bars-1;
   while(i>=0)
     {
      shift=iBarShift(Symbol(),PERIOD_MN1,Time[i],0)+1;
         if(TimeMonth(Time[i])==1)
           {
            yearClose=iClose(Symbol(),PERIOD_MN1,shift);
            yearHigh=iHigh(Symbol(),PERIOD_MN1,iHighest(Symbol(),PERIOD_MN1,MODE_HIGH,12,shift));
            yearLow=iLow(Symbol(),PERIOD_MN1,iLowest(Symbol(),PERIOD_MN1,MODE_LOW,12,shift));
           }
         h[i]=yearHigh;
         c[i]=yearClose;
         l[i]=yearLow;
         i--;
        }

thanks for help

12
To add comments, please log in or register