Very important bug in MT5 - page 2

 
Francesco Pinta:

UPDATE:

I've modified the script in order to printing in the debug also the date and time of the bar.

As I guessed, also the time value remains to the old value. In the picture (Selection_273.png), before the 2018.12.17 the DAY0 time is "2018.12.14 00:00" and after midnight, at 2018.12.17, the DAY0 time still remains "2018.12.14 00:00".

You are wasting our time, especially Alain's. If you want it solved, then supply a real, testable code, that compiles and runs, so that @Alain Verleyen can reproduce the situation and report it to MetaQuotes if applicable.

If you continue to dance around and not address the issue properly as a responsible person, then don't expect anyone to help resolve it. Stop wasting our time!

Forum on trading, automated trading systems and testing trading strategies

Very important bug in MT5

Alain Verleyen, 2018.12.14 14:33

Can you provide a complete testcase code please ? One that I can just compile and run to reproduce your issue.
 
Fernando Carreiro:

You are wasting our time, especially Alain's. If you want it solved, then supply a real, testable code, that compiles and runs, so that @Alain Verleyen can reproduce the situation and report it to MetaQuotes if applicable.

If you continue to dance around and not address the issue properly as a responsible person, then don't expect anyone to help resolve it. Stop wasting our time!

Fernando, I already sent the code to Alain.

 
Fernando Carreiro:

You are wasting our time, especially Alain's. If you want it solved, then supply a real, testable code, that compiles and runs, so that @Alain Verleyen can reproduce the situation and report it to MetaQuotes if applicable.

If you continue to dance around and not address the issue properly as a responsible person, then don't expect anyone to help resolve it. Stop wasting our time!

Thanks for your help Fernando.

I confirm Francesco sent me code in private. Just didn't have time yet to check.

 
Alain Verleyen:

Thanks for your help Fernando.

I confirm Francesco sent me code in private. Just didn't have time yet to check.

So I checked. Your code seems ok, so that's not the problem. I don't have problem but the code is running and I will wait next new day to see, however I know I will not have a problem.

My assumption is : it's a VPS issue, a new daily bar is not created at midnight (broker time) but at first tick after midnight. As you get and print the values on each tick, it seems on some of your VPS, Daily timeframe is not yet updated. Either your VPS is not powerful enough or not enough resources are available at some moments. Check CPU, RAM and Hard Disk capabilities.

Your provided only screenshots of your log so I can't be 100% sure. Can you post a log file or at least a greater excerpt of your log AFTER midnight, showing several ticks output.

As a workaround, you can add a checking of Daily data comparing bar 0 time to timecurrent.

 
Alain Verleyen:

So I checked. Your code seems ok, so that's not the problem. I don't have problem but the code is running and I will wait next new day to see, however I know I will not have a problem.

My assumption is : it's a VPS issue, a new daily bar is not created at midnight (broker time) but at first tick after midnight. As you get and print the values on each tick, it seems on some of your VPS, Daily timeframe is not yet updated. Either your VPS is not powerful enough or not enough resources are available at some moments. Check CPU, RAM and Hard Disk capabilities.

Your provided only screenshots of your log so I can't be 100% sure. Can you post a log file or at least a greater excerpt of your log AFTER midnight, showing several ticks output.

As a workaround, you can add a checking of Daily data comparing bar 0 time to timecurrent.

Ok, I'll work to coding the workaround.

Unfortunatelly another issue appears! :( 

The daily bar starts ok and at 5:09:34 of 20/12/2018 (in the examples) freezes che close value! (the code is the same)

My question is: I discover these problems because I have this EA running on three different VPS. What about other strategies? I can't immagine if these bugs affects also other EA!

Files:
 

Alain Verleyen:

Check CPU, RAM and Hard Disk capabilities.

And timezones, and symbol's trading hours...

 
Francesco Pinta:

Hi,

I've developed a EA on MT5 and I run it on two VPS (same VPS provider, same VPS configuration, same broker, same instrument (DAX)) and I notice some diffence in the entry, that is one EA place the order but the other not.

After some debug I discover that the CopyHigh, CopyClose, CopyOpen, CopyLow function on daily bars fail to give me the right info. In one VPS the result is ok, in the other VPS the result is shifted by one day.

This is the code:


Randomically happens that the result bar is shifted by one, so DayOpen[1] is not the yesterday bar but the day before yesterday (the same bug affect also the other array and the shift is also for the other elements of the arrays).



I have realized that, during backtests, I was unable to do backtesting using today's data. Therefore, historical data is tested until yesterday data, so DayOpen[0] is, in fact, yesterday. I take that as behaviour, not necessarily a bug. I might be wrong.
 
kypa:

And timezones, and symbol's trading hours...

I already did it.
 
Arthur Albano:
I have realized that, during backtests, I was unable to do backtesting using today's data. Therefore, historical data is tested until yesterday data, so DayOpen[0] is, in fact, yesterday. I take that as behaviour, not necessarily a bug. I might be wrong.
Off-topic, this thread is not about backtest.
 
Francesco Pinta:

Ok, I'll work to coding the workaround.

Unfortunatelly another issue appears! :( 

The daily bar starts ok and at 5:09:34 of 20/12/2018 (in the examples) freezes che close value! (the code is the same)

My question is: I discover these problems because I have this EA running on three different VPS. What about other strategies? I can't immagine if these bugs affects also other EA!

I will investigate more as I saw weird things, but I am lacking time...

Reason: