MQL5 bug when working with iClose/iOpen timeseries access, etc. - page 6

 

I did catch iTime hanging up on PERIOD_M1.


My system:

2018.11.15 10:03:35.115 Terminal        MetaTrader 5 x64 build 1944 started (MetaQuotes Software Corp.)
2018.11.15 10:03:35.118 Terminal        Windows 10 (build 17134) x64, IE 11, UAC, Intel Core i3-3120 M  @ 2.50 GHz, Memory: 4141 / 8077 Mb, Disk: 154 / 415 Gb, GMT+2
2018.11.15 10:03:35.118 Terminal        C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075

Runs normally, no Portable.

On AUDUSD, M5 I ran "Test CopyTime.mq5" at 10:08:20

2018.11.15 10:08:20.159 Experts expert Test CopyTime (AUDUSD,Daily) loaded successfully

Expert Advisor code

//+------------------------------------------------------------------+
//|                                                Test CopyTime.mq5 |
//|                              Copyright © 2018, Vladimir Karputov |
//|                                           http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2018, Vladimir Karputov"
#property link      "http://wmua.ru/slesar/"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   datetime CM1_T[1];
   datetime CM2_T[1];
   CopyTime(_Symbol,PERIOD_M1,0,1,CM1_T);
   CopyTime(_Symbol,PERIOD_CURRENT,0,1,CM2_T);
   Comment("CopyTime PERIOD_CURRENT: "+TimeToString(CM2_T[0],TIME_DATE|TIME_SECONDS)+"\n"+
           "CopyTime PERIOD_M1: "+TimeToString(CM1_T[0],TIME_DATE|TIME_SECONDS));
  }
//+------------------------------------------------------------------+

Then in

2018.11.15 10:27:45.583 Network '10169544': connection to MetaQuotes-Demo lost

forcibly disconnected from the Internet (router turned off)


After reconnecting to

2018.11.15 10:32:58.823 Network '10169544': authorized on MetaQuotes-Demo through Access Point EU 2 (ping: 50.64 ms)

code

CopyTime(_Symbol,PERIOD_M1,0,1,CM1_T)

has ceased to give the current open time of a bar on M1, and all the time gives the last time before the connection is broken.


2018.11.15 10:08:20.159 Experts expert Test CopyTime (AUDUSD,Daily) loaded successfully
2018.11.15 10:27:45.583 Network '10169544': connection to MetaQuotes-Demo lost
2018.11.15 10:32:58.823 Network '10169544': authorized on MetaQuotes-Demo through Access Point EU 2 (ping: 50.64 ms)
2018.11.15 10:32:58.823 Network '10169544': previous successful authorization performed from 178.165.123.77 on 2018.11.15 10:03:38
2018.11.15 10:32:58.900 Network '10169544': terminal synchronized with MetaQuotes Software Corp.
2018.11.15 10:32:58.900 Network '10169544': trading has been enabled - hedging mode
2018.11.15 10:33:00.653 Network '10169544': scanning network for access points
2018.11.15 10:33:19.062 Network '10169544': scanning network finished
2018.11.15 10:33:19.062 Network '10169544': auto connecting to a better access point with 95 % quality (previous: 88 %)
2018.11.15 10:33:19.062 Network '10169544': connection to MetaQuotes-Demo lost
2018.11.15 10:33:19.716 Network '10169544': authorized on MetaQuotes-Demo through Access Point EU 4 (ping: 65.57 ms)
2018.11.15 10:33:19.716 Network '10169544': previous successful authorization performed from 178.165.123.77 on 2018.11.15 10:32:58
2018.11.15 10:33:19.825 Network '10169544': terminal synchronized with MetaQuotes Software Corp.
2018.11.15 10:33:19.825 Network '10169544': trading has been enabled - hedging mode


Maybe it's a static array

datetime CM1_T[1];

And need to use a dynamic array?


Added: replaced CM1_T[1] with a dynamic CM1_T[]. After forcibly breaking the connection for about three minutes, the string

CopyTime(_Symbol,PERIOD_M1,0,1,CM1_T)

Outputs the last known time with M1 before breaking the link.

Files:
 
Vladimir Karputov:

I did catch iTime hanging up on PERIOD_M1.

My system:

Runs normally, no Portable.

On AUDUSD, M5 I ran "Test CopyTime.mq5" at 10:08:20

Expert Advisor code

Then in

forcibly disconnected from the Internet (router turned off)

After reconnecting to

code

has ceased to give the current open time of a bar on M1, and all the time gives the last time before the connection is broken.

Maybe it's a static array

and need to use a dynamic array?

Try to put it on M30, and get data from M30 as well. That's exactly how it freezes, which is shown in the video. Switching the timeframe doesn't help, only removing the indicator and then installing it.

 
Vitaly Muzichenko:

Try putting it on M30, and getting data from M30 as well. That's exactly how I'm getting the freeze, which is shown in the video. Switching the timeframe does not help, only removing the indicator and then installing it.

I confirm that playing with the reloading of the indicator is not 100% helpful, so to say that for every 3 times I manage to reload the indicator completely and of course not to guess by coffee grounds, it's easier to unload the indicator and reload it on the tool.

But it's a hell of a thing, what kind of trading automation can we talk about in this kind of dancing with tambourines.

 
Vladimir Karputov:

*** Maybe it's the static array

I have dynamic arrays, as it's originally written that it's better to use them at SoruXXX, the problem is not the type of array.

 
You know, at work, I have to write a lot to technical support of different companies (Symantec, DeviceLock, Kaspersky, FortiNet, Xspider, etc.), but never before I had to find the cause of the problem described by me, mda .... There remains only to write myself a fix :)
 
Farkhat Guzairov:

... but unfortunately, the MQ product, has been my focus for about 10 years.

in another 10 years everything will be working properly )))))))))))))))))))))

 
I had a similar problem about six months ago. I was writing an arbitrage robot, so I was working with a large list of characters at the same time. I was writing an arbitrage robot, so I was working with a big list of symbols at the same time. The robot was protected from working with outdated quotes, so the problem was only a decrease in activity. The only thing that helped was re-attaching the EA to the chart.
 
We will reproduce and correct.
 
Renat Fatkhullin:
We will reproduce and correct.

How soon can we expect a correction?

 
Farkhat Guzairov:

How soon can we expect a fix?

The freezing of alien invisible timeframe update after reconnect has been dealt with and fixed. The reason was wrong cache statuses after the reconnect.

Beta version 1946 is available via Help -> Check Desktop Updates -> Latest Beta Version.

Reason: