I've got a little problem.
Thank you for your advice
Thank for reporting this issue, I will check and try to improve this function.
Sorry but there is no error.
If a bar doesn't exist, iBarShift returns the nearest previous bar. It's expected and consistent with mql4 version.
What are you expecting and why ?
I am thinking that maybe the optional argument 'exact' just needs to be used: