Download MetaTrader 5

Need equivalent code for iBarshift either C++ or MQL4

To add comments, please log in or register
Interested in Signals activity? Come and track!
Proximus
760
Proximus 2013.11.27 15:02 
Hi guys please if anyone can give me an equivalent code to iBarshift, the expanded version of the function so i can study it more deeply.It can be in any programming language you want just i need it to study it .Thanks ahead!
whroeder1
14519
whroeder1 2013.11.27 15:43  
Proximus: anyone can give me an equivalent code to iBarshift, the expanded version of the function so i can study it more deeply. It can be in any programming language you want just i need it to study it.
  1. For current pair, current timeframe, exact=false
    equivalent to
    int iBarShift(datetime tm){ return( ArrayBsearch(Time, tm) ); }
    or
    int iBarShift(datetime tm){ 
     int iLimit = Bars - 1;
     for(int iBar = 0; iBar < iLimit; iBar++) if(Time[iBar] <= tm) break;
     return(iBar);
    }
  2. At https://www.mql5.com/en/forum/145041 I report that iBarShift doesn't match the documentation.
Proximus
760
Proximus 2013.11.28 15:50  
WHRoeder:
  1. For current pair, current timeframe, exact=false
    equivalent to
    or
  2. At https://www.mql5.com/en/forum/145041 I report that iBarShift doesn't match the documentation.

Thanks man, i`m very grateful!
To add comments, please log in or register