angevoyageur:
Hi,
Thank for reporting this issue, I will check and try to improve this function.
Hi Alain,
Thank you so much
stitchtrader:
Hi -:D
I use such an amazing function iBarShift made by Alain (Thank you Alain!)
I've got a little problem.
This returns an accurate bar shift in most of symbols.
But at the beginning of week with some symbols such as S&P500,
it returns Friday last bar !
It is because the Monday first bar starts at 1:00 (not 0:00) on the H1 and lower timeframe.
Though, it starts at 0:00 on the H2 and higher timeframe, oddly.
How can I improve the iBarShift function in this case ?
Thank you for your advice
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:
iBarShift(Symbol(),PERIOD_H1,D'2014.10.13 00:00',true);
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi -:D
I've got a little problem.
Thank you for your advice