You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The "nearest" keeps always an ambiguity, so I suggest that the function returns the first bar which time is less than or equal to the specified time.
Please, look at this very common example :
I have an opened order and I want to know the low of the bar on which the order was opened.
The OrderOpenTime is not generally the open time of a bar, so
iBarShift(NULL, 0, OrderOpenTime(), false) will return the right shift if the order was opened in the first half period of the bar, but the wrong shift if the order was opened in the second half period.
It's just a consistency question, I know that I can write:
Thanks for your comment,
Michel