I'm in D1, and using iBarShift to get index of bars in Weekly timeframe. These bars in Weekly TF are visible!!! No reason to return -1...
Maybe, but maybe, i'm not sure about this... this stuff seems to happens in charts when history need to be downloaded at opening. But after bars are
available, iBarShift doesn't work anyway.
I'm in D1, and using iBarShift to get index of bars in Weekly
timeframe. These bars in Weekly TF are visible!!! No reason to return -1...
Maybe, but maybe, i'm not sure about this... this stuff seems to happens in charts when history need to be downloaded at opening. But after
bars are available, iBarShift doesn't work anyway.
I tried to delete cache files .hc, but not lucky.
You are doing worst trying to interfere with hc files. On MTF it's normal to have iBarShift (or other time series functions) to return -1.
Previously it was on chart timeframe, which is different. Anyway for sure it's not easy to make the difference between expected behaviour and a bug.
3 times in 1 hours to get M1 data is normal behaviour for MT5 requestion MTF data (data on a different timeframe than the chart
timeframe).
Checking the return value of a function is not an option, it's a good practice, unless you know it can't fail.
It's good because it's why MT5 is faster than MT4 (one reason among other). There a lot of asynchronous behaviour with MT5, which means
if something is not ready the function returns instead of waiting. There are several ways to deal with it depending of your needs
(wait next tick, a loop with Sleep(), a timer...).
It's of course a bit annoying for such a simple thing, it has a good justification.
You are right, letting indicator recalculate data until iBarShift!=-1, i got the right indexes..... but 16 seconds/lot of ticks!!! This is too much... cannot be an acceptable delay when we are playing with money!
If data are available on local, is it "normal" for you that the platform serve them in 16 seconds/more and more ticks needed? And we consider MT5 fast?!?
So, let an example: we open a position, and decide to close it checking some data in other timeframe. We have to (long) wait MT5 decide to serve these data before we can close a position ?!?
You are right, letting indicator recalculate data until iBarShift!=-1, i got the right indexes..... but 16 seconds/lot of ticks!!!
This is too much... cannot be an acceptable delay when we are playing with money!
If data are available on local, is it "normal" for you that the platform serve them in 16 seconds/more and more ticks needed? And we
consider MT5 fast?!?
So, let an example: we open a position, and decide to close it checking some data in other timeframe. We have to (long) wait MT5 decide to
serve these data before we can close a position ?!?
To me this seems madness!
Is this also with the last beta or only release version 2361 ?
In case it's also with the last beta (2402), please post the code (compilable and runnable) to reproduce it.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I'm in D1, and using iBarShift to get index of bars in Weekly timeframe. These bars in Weekly TF are visible!!! No reason to return -1...
Maybe, but maybe, i'm not sure about this... this stuff seems to happens in charts when history need to be downloaded at opening. But after bars are available, iBarShift doesn't work anyway.
I tried to delete cache files .hc, but not lucky.
I'm in D1, and using iBarShift to get index of bars in Weekly timeframe. These bars in Weekly TF are visible!!! No reason to return -1...
Maybe, but maybe, i'm not sure about this... this stuff seems to happens in charts when history need to be downloaded at opening. But after bars are available, iBarShift doesn't work anyway.
I tried to delete cache files .hc, but not lucky.
You are doing worst trying to interfere with hc files. On MTF it's normal to have iBarShift (or other time series functions) to return -1.
Previously it was on chart timeframe, which is different. Anyway for sure it's not easy to make the difference between expected behaviour and a bug.
Forum on trading, automated trading systems and testing trading strategies
iBars() takes forever
Alain Verleyen, 2020.04.14 03:05
3 times in 1 hours to get M1 data is normal behaviour for MT5 requestion MTF data (data on a different timeframe than the chart timeframe).
Checking the return value of a function is not an option, it's a good practice, unless you know it can't fail.
It's good because it's why MT5 is faster than MT4 (one reason among other). There a lot of asynchronous behaviour with MT5, which means if something is not ready the function returns instead of waiting. There are several ways to deal with it depending of your needs (wait next tick, a loop with Sleep(), a timer...).
It's of course a bit annoying for such a simple thing, it has a good justification.
Ok, i checked MTF iBarShift.
You are right, letting indicator recalculate data until iBarShift!=-1, i got the right indexes..... but 16 seconds/lot of ticks!!! This is too much... cannot be an acceptable delay when we are playing with money!
If data are available on local, is it "normal" for you that the platform serve them in 16 seconds/more and more ticks needed? And we consider MT5 fast?!?
So, let an example: we open a position, and decide to close it checking some data in other timeframe. We have to (long) wait MT5 decide to serve these data before we can close a position ?!?
To me this seems madness!
Ok, i checked MTF iBarShift.
You are right, letting indicator recalculate data until iBarShift!=-1, i got the right indexes..... but 16 seconds/lot of ticks!!! This is too much... cannot be an acceptable delay when we are playing with money!
If data are available on local, is it "normal" for you that the platform serve them in 16 seconds/more and more ticks needed? And we consider MT5 fast?!?
So, let an example: we open a position, and decide to close it checking some data in other timeframe. We have to (long) wait MT5 decide to serve these data before we can close a position ?!?
To me this seems madness!
Is this also with the last beta or only release version 2361 ?
In case it's also with the last beta (2402), please post the code (compilable and runnable) to reproduce it.
Is this also with the last beta or only release version 2361 ?
In case it's also with the last beta (2402), please post the code (compilable and runnable) to reproduce it.
It's with 2361. Didn't check latest beta.
They made changes about this stuff in latest beta?