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
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.
Build 880 fix the bug on Bars(), and all is working well now.
I think there is a minor bug in your code:
If the the last tick 'opens' a new bar then if(time>LastBar) becomes false - because now time == LastBar
And later we land here:
And now shift == 0 which returns -1 instead of 0!
So I think this:
should be changed to
Calli
I think there is a minor bug in your code:
If the the last tick 'opens' a new bar then if(time>LastBar) becomes false - because now time == LastBar
And later we land here:
And now shift == 0 which returns -1 instead of 0!
So I think this:
should be changed to
Calli
Your correction would work too, but the case 'time==LastBar' is processed as a "normal" case.
The statement
if(time>LastBar)
was added as a bug fix if time is greater than current bar 0 time.
Check it yourself (in mt4).
start it on a e.g. m5 chart. The script stops if your function (I renamed it to iBarShift_MQ5) returns an index less than 0.
I changed the returned negative values in order to know from where the negative index was returned (could have used e.g. __LINE__ as well).
Check it yourself (in mt4).
start it on a e.g. m5 chart. The script stops if your function (I renamed it to iBarShift_MQ5) returns an index less than 0.
I changed the returned negative values in order to know from where the negative index was returned (could have used e.g. __LINE__ as well).
?
This is a code for mql5/MT5. No point to use it under mql4/MT4.