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
Can you explain how your Function works in relation to the exact parameter ? what I mean is what is returned ? the English Documentation for iBarShift() is incorrect . . .
If the bar having the specified open time is missing, the function will return -1 or the nearest bar shift depending on the exact.
Hi,
the fact that it works well with 842 will not help as everybody is forced to update to latest version, or do you have a method to avoid the live updates?
well done for the updated routine
thanks
Yesterday I did a test with build 842 on a MT5 broker. There is not yet an update to build 858/868.
If you are using Metaquotes demo-server then the update is immediate, but not with "normal" brokers, at least for some of them.
Yesterday I did a test with build 842 on a MT5 broker. There is not yet an update to build 858/868.
If you are using Metaquotes demo-server then the update is immediate, but not with "normal" brokers, at least for some of them.
ah! okay, I understand the brokers control the update to their users when they are ready.
thanks
When you said that mql4 documentation is incorrect, are you referring to ?
"If the bar having the specified open time is missing, the function will return -1 or the nearest bar shift depending on the exact."
So my function returns exactly the same as mql4 version. If exact is false, it returns the shift of the bar containing the time value and not necessarily the nearest bar shift.
Yes, the Russian translated via Google tells a different story . . .
Search bar at the time. The function returns the offset of the bar, which owns the specified time. If there is no specified time bar ("hole" in the story), the function returns, depending on the parameter Exact , -1 or offset the nearest bar.
. . . it's not about the Open time but about the time being within the life of a bar . . .
Yes, the Russian translated via Google tells a different story . . .
. . . it's not about the Open time but about the time being within the life of a bar . . .
Yes, so my version works as Russian documentation. Have you reported this translation error to Service Desk ?
Nope.
Done.
What rhetoric are you talking about?
Don't worry, I checked it out. It's not my code that wanders the terminal, it's a new MT5/mql5 bug (build 858? - 868).
All versions, including yours, are bugged when tested with DateTime not matching the bar open time.
Please, write in English. Automatical translater is not perfect.
Here is code and results from MT4:
22:52:16 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:15'; exacts=false;
22:52:16 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:15 is 6
22:52:29 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:17'; exacts=false;
22:52:29 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:17 is 6
22:52:38 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:14'; exacts=false;
22:52:38 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:14 is 7
22:53:32 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:15'; exacts=true;
22:53:32 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:15 is 6
22:52:52 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:17'; exacts=true;
22:52:52 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:17 is 6
22:53:17 sBarShift EURUSD,M15 inputs: searchDate='2013.10.25 21:14'; exacts=true;
22:53:17 sBarShift EURUSD,M15: iBarShift for 2013.10.25 21:14 is 7
Here are results from MT5:
searchDate='2013.10.25 21:15'; exacts=false;
2013.10.27 22:58:08 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:15 is 6 in 0 milliseconds.
searchDate='2013.10.25 21:17'; exacts=false;
2013.10.27 22:58:20 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:17 is 5 in 0 milliseconds.
searchDate='2013.10.25 21:14'; exacts=false;
2013.10.27 22:58:29 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:14 is 6 in 0 milliseconds.
searchDate='2013.10.25 21:15'; exacts=true;
2013.10.27 22:58:40 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:15 is 6 in 0 milliseconds.
searchDate='2013.10.25 21:17'; exacts=true;
2013.10.27 22:58:49 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:17 is -1 in 0 milliseconds.
searchDate='2013.10.25 21:14'; exacts=true;
2013.10.27 22:58:58 TestBarShift (EURUSD,M15) iBarShift (komposter) for 2013.10.25 21:14 is -1 in 0 milliseconds.
I see the deffirence in results and I'll fix my code shortly.
As for your code - I can't test it because it don't work in last MT5 build.
Please, write in English. Automatical translater is not perfect.
Here is code and results from MT4:
Here is results from MT5:
I see the deffirence in results and I'll fix my code shortly.
As for your code - I can't test it because it don't work in last MT5 build.
Thank you, I have to fix my code also when exact is true, as I misunderstood this parameter. The English documentation for iBarShift is wrong.
The mql5 bug is on Bars() function, I reported it to Service Desk.