MT5 BUG with iBarShift? - page 2

 

I put this code in an indicator with only OnCalculate function. Just this indicator on chart. No expert, no objects, no other indicators.

I tried it on these TimeFrames: M1, M5, M15, M30, H1, H4, D1, W1, MN.


In TF <= H1, it works ok, return 1. In TF >=H4 it returns -1.

If i change iClose index to iBars-1, it returns 1 in all TF, works OK!


Checked with more symbols (eg. EURUSD, EURJPY), and also with an other fresh MT5 installation, latest MT5 from MetaQuotes build 2401. 

 
antony23:

I put this code in an indicator with only OnCalculate function. Just this indicator on chart. No expert, no objects, no other indicators.

I tried it on these TimeFrames: M1, M5, M15, M30, H1, H4, D1, W1, MN.


In TF <= H1, it works ok, return 1. In TF >=H4 it returns -1.

If i change iClose index to iBars-1, it returns 1 in all TF, works OK!


Checked with more symbols (eg. EURUSD, EURJPY), and also with an other fresh MT5 installation, latest MT5 from MetaQuotes build 2401. 

That's why I asked you a code which I could run directly. I tried it with a script and now you said me it's with an indicator.
 

Sorry Alain, didn't understand you mean the file itself.

Here the file.

Files:
TEST.mq5  2 kb
 
antony23:

Sorry Alain, didn't understand you mean the file itself.

Here the file.

On Build 2361. It's erratic, even with Bars-1, it sometimes return -1 or an Close value of 0.0

2020.05.02 19:53:09.930 339265 (EURJPY,H4)      iBars= 10863 iClose[10862]=0.000000 iBarShift: 1
2020.05.02 19:53:12.407 339265 (EURJPY,D1)      iBars= 7023 iClose[7022]=137.720000 iBarShift: 1
2020.05.02 19:53:14.687 339265 (EURJPY,M5)      iBars= 10000 iClose[9999]=119.076000 iBarShift: -1

On build 2401, it's better (but it also report -1, though the close value is always ok).

When index is = to bars, what is happening is the platform starts to download more data, so the -1.

 
Sorry Alain, index==iBars is on iClose, but in iBarShift i use index=1 in iTime, so it should always return correct value, that is 1.

The problem is if iCose just before use an index not available in chart. 
I didn't check iclose value, anyway i suspect the same could happen using any iXxx function with not available index before iBarShift. 

iTime call inside iBarShift seems to always return correct value and seems not influenced, as i shown in first post. 

Using iClose with an available index on chart, i have no issue at all with iBarShift. 


 
Anyway it is not correct imho that iClose with not available index influence next call to iBarshift with correct and available data. 
 
antony23:
Sorry Alain, index==iBars is on iClose, but in iBarShift i use index=1 in iTime, so it should always return correct value, that is 1.

The problem is if iCose just before use an index not available in chart. 
I didn't check iclose value, anyway i suspect the same could happen using any iXxx function with not available index before iBarShift. 

iTime call inside iBarShift seems to always return correct value and seems not influenced, as i shown in first post. 

Anyway using iClose with an available index on chart, i have no issue at all with iBarShift. 


I know that, I just reported my results and as you can see have with an available index, it sometimes return -1.

It would be time for Metaquotes to fix all that mess once for all. We agree.

 
Thank you Alain.

I moved to MT5 from MT4 but i'm not happy, these bugs are very severe imho. 
 

I'm having same trouble in other indicators where i use iBarShift!!! And problem this time is not iClose, it seems random! I can't fix it.

In this condition, MT5 is unusable!

Alain please let me know if you have any news, i'm thinking to roll back to MT4, but i hope you can give me good news as soon as possible.

Thanks

 
antony23:

I'm having same trouble in other indicators where i use iBarShift!!! And problem this time is not iClose, it seems random! I can't fix it.

In this condition, MT5 is unusable!

Alain please let me know if you have any news, i'm thinking to roll back to MT4, but i hope you can give me good news as soon as possible.

Thanks

Is it similar to what is already reported earlier ?