how to get bar index (or shift) number from time?

 
how to get bar index (or shift) number from time?

function
datetime iTime( string symbol, int timeframe, int shift)
can get datetime from shift,
then how to get shift from one datetime?

Or
how to get OpenOrder's shift position.

now MT only get OpenOrder's datetion with function
datetime OrderOpenTime( )


Is it
int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
????
 
Yes, function iBarShift() is made just for these cases.
 
Rashid Umarov:
Yes, function iBarShift() is made just for these cases.

THis is just for MT4   .....is anythink for mt5  ?

 
Marcin Rutkowski:

THis is just for MT4   .....is anythink for mt5  ?

https://www.mql5.com/en/code/1864
iBarShift
iBarShift
  • votes: 47
  • 2013.10.25
  • Alain Verleyen
  • www.mql5.com
But this function is not included in MQL5, mainly because MQL5 provides all necessary basic, low-level, functions to process such operation in a library. What I discovered, remarkably, is that all four versions are bugged, in the sense they don't reproduce exactly the MQL4 iBarShift(). Indeed, when the datetime given as input parameter, don't...
Reason: