if you change date to 24 like "2013.02.24 09:05" you will get it
Yes, I tested with 25th, today, there were no bars around 9 am yesterday as it was Sunday, neither was there a H1 bar with an open time of 9:05 this morning.
It seems the Documentation got screwed up in translation . . . Google translation from the Russian
"Search bar at the time. The function returns the offset of the bar, which owns the specified time. If for the time bar is missing (the "hole" in the history), the function returns, depending on the parameterexact , -1 or offset the nearest bar. "
it is in fact nothing to do with the opening time of the bar.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
you tested "2013.02.25 09:05" i assume
if you change date to 24 like "2013.02.24 09:05" you will get it
your english is good
only how we understand what is written is sometimes different
if i have problems with a function and wants to know what it does
then the answer will be mostly given to me with a short testing program
yes, I am doing it....
for today´s setup: 2013.02.25 09:05 return StartShift1 and StartShift2 the same value, different -1
mql ignore last parameter true or false....
Fce. iBarShift() will not solution for my problem: Does exist bar with exact open time? Maybe compare open time each bars, compare datetime value...
modify code:
I using iBarShift(..., true) - if bar with exact open time exist - it must the same value datetime - therefore next step: compare datetime values...
it is ok
modify code:
I using iBarShift(..., true) - if bar with exact open time exist - it must the same value datetime - therefore next step: compare datetime values...
it is ok
Another solution
It seems the Documentation got screwed up in translation . . . Google translation from the Russian
"Search bar at the time. The function returns the offset of the bar, which owns the specified time. If for the time bar is missing (the "hole" in the history), the function returns, depending on the parameterexact , -1 or offset the nearest bar. "
it is in fact nothing to do with the opening time of the bar.
I think it mean not "hole", but before the earliest or after the latest bar, then it will return -1 if use "exact".
I believe this topic duplicates this one https://www.mql5.com/en/forum/141486/page2