iBarShift
Last updated
Last updated
Returns the bar index for a specified time in the symbol's price history.
symbol
: The symbol to get data for
timeframe
: The timeframe of the data (in minutes)
time
: The time to search for
exact
: Whether to require an exact match
Returns a number
representing the index of the bar corresponding to the specified time. Returns -1 if no matching bar is found.
The iBarShift
method searches for a bar with a specific opening time and returns its index. If exact
is true, only bars with exactly matching times will be considered. If exact
is false, the method will return the index of the nearest bar that opened before the specified time.