MQL4 Reference Timeseries and Indicators Access iBarShift
iBarShiftSearch for a bar by its time. The function returns the index of the bar which covers the specified time.
Parameters symbol [in] Symbol name. NULL means the current symbol. timeframe [in] Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe. time [in] Time value for searching. exact=false [in] Return mode when the bar is not found (false - iBarShift returns the nearest, true - iBarShift returns -1). Returned value Index of the bar which covers the specified time. If there is no bar for the specified time (history "gap"), the function will return -1 or the nearest bar index (depending on exact parameter). Example:
|