Errors, bugs, questions - page 427

 
uncleVic:

Gets EMPTY_VALUE, as we return it if the file is not opened. If it's more convenient to get 0.0, return 0.0.

And I need to return something. Reading a file that didn't open is not good.

About open error. Write it like this:

Here is a screenshot of the tester. Is it the same in the terminal?


Yes in the terminal is the same and the error This is what it says :

File size is 20 mb, about 2.5 million values.

at the very beginning of the test 20 times during the opening it succeeded

In the beginning of the test, about 20 times when I opened the file it succeeded in getting the values I wanted, then the error 5004 keeps coming up - file could not be opened,

I tried with 2 mb of about 400k values - it opens, but no one wants to get more, I looked at the data

Task manager, 2.5 gb of RAM is enough. (another 500 mb free !)

 

The CODE POLTERGHEIST has started in my computer, if before it did not open a file of 20 mb.

at the moment there is a test with an open file of 38 mb. with 5.5 million values (data from 2005),

but since 2001 - about 10 mln values and with a size under 65 mb, it won't open. It's interesting - and it's not clear why ?

Документация по MQL5: Файловые операции / FileOpen
Документация по MQL5: Файловые операции / FileOpen
  • www.mql5.com
Файловые операции / FileOpen - Документация по MQL5
 
Renat:
Unfortunately, nothing will help with the specified card anymore. If it's a laptop, the situation is hopeless. Otherwise, for 1000-1500 rubles, you can buy a decently powerful graphics card that will remove all performance issues.


So tell me mt4 \ mt5 through DirectX 2D acceleration works or what ... ?


which of the above parameters are important for vector graphics acceleration ... or all ?

there's another question ... drivers for HD2000 embedded in the processor, officially do not support Windows Server 2008 r2 SP1 64bit, -

but only vista and 7ka 64 bit ....


this incomplete compatibility might have some effect ... ?

(although the drivers are up, work even in HD games run...)


2. What about mt4\mt5 platforms with 2D video hardware compatibility on Windows Server 2008 r2 SP1 64bit ?


Which manufacturer is best to choose ... radionics ... nVidia ?


any speed and adapter compatibility tests for mt4/mt5 done .... ?


thanks.

 
Im_hungry:

Yes in the terminal the same and the error This is what it says :

File size 20 mb, about 2.5 million values

In the beginning of the test, about 20 times during the opening it was possible to

In the beginning of the test, the opening of the file about 20 times was successful, then the error 5004 keeps coming up - the file could not be opened,

I tried with 2 mb. about 400 thousand values - it opens, but it won't open bigger, I looked at the data

Task manager, 2.5 gb of RAM is enough (another 500 mb free ! (another 500 mb free !)

I didn't read much, but the highlighted text caught my eye... Are you closing the file?

Do you handle its descriptor correctly at all?

 
AlexSTAL:

I didn't read much, but the highlighted text caught my eye... Are you closing the file?

In general, correctly handle its descriptor?

The logic (judging by the given codes) is almost correct. Except for the fact that it reads and writes after checking the handle (and then closes the file as well).

I think the problem is different here:

1. the indicator on each tick opens the file, writes data, closes the file.

2. The Expert Advisor (I think it is on every tick) opens the file, reads data, closes the file.

Since it happens in different flows, the larger the size of the file, the more possible it is for the Expert Advisor to "run into" the file opened by the indicator when opening it. And since the open flagFILE_SHARE_READ is not used, there are consequences.

In my opinion, the treatment of the problem can be as follows:

1) Open the file (both in the indicator and in the Expert Advisor) in OnInit with the flag FILE_SHARE_READ.

2. Call FileFlush(handle) in the indicator after the writing .

3. Close the file in OnDeinit.

Like this.


Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов - Документация по MQL5
 
tester_el_pro:


So tell me mt4 \ mt5 through DirectX 2D acceleration works or what ... ?


The terminal uses normal Windows GDI which needs a 2D accelerator.

When choosing a card, get any external 3D, even the lowest price level - it will be enough.
And you won't have to compare basic video card capability points.

 
uncleVic:

The logic (judging from the given codes) is almost correct. Except for the fact that it reads and writes after checking the handle (and then closes the file as well).

In my opinion, a cure for the problem could be this:

1. open the file (both in the indicator and in the Expert Advisor) in OnInit with the flag FILE_SHARE_READ.

2. Call FileFlush(handle) in the indicator after the writing .

3. Close the file in OnDeinit.

Like this.


Thanks for this in the future when using it in real time

I will use your advice in the future to work with the file of Expert Advisor and indicator.

 
AlexSTAL:

I didn't read much, but the highlighted text caught my eye... Do you close the file?

Are you handling the descriptor correctly at all?

Yes, of course - it sees the file but does not want to read it due to open error 5004
 
uncleVic:

The logic (judging from the given codes) is almost correct. Except for the fact that it reads and writes after checking the handle (and then closes the file as well).

I think the problem is different here:

1. the indicator on each tick opens the file, writes data, closes the file.

2. The Expert Advisor (I think it is on every tick) opens the file, reads data, closes the file.

Since it happens in different flows, the larger the size of the file, the more probable it is that the open file will be opened by the indicator. And since the open flagFILE_SHARE_READ is not used, there are consequences.

In my opinion, the treatment of the problem can be as follows:

1) Open the file (both in the indicator and in the Expert Advisor) in OnInit with the flag FILE_SHARE_READ.

2. Call FileFlush(handle) in the indicator after the writing .

3. Close the file in OnDeinit.

Approximately so.



I'm sorry, the work of the indicator is different,

1. Before testing in the terminal I run the indicator

2. it saves the bar time and its correlation value on each bar

3. I put the file in the tester folder, where it should be C:{Program Files\MetaTrader 5\tester\Agent-127.0.0.1-3000\MQL5\Files.

4. I launch an Expert Advisor, which works by opening bars - and since 2005 it reads all recorded data

It reads (38 Mb), but since 2002 it does not read (67 Mb)

 

Tried to record the same in the same tool but in mt4

i transferred bin file to mt5 tester folder - none of the files

it doesn't open - error 5004, in MT5 it still opens something.


i implemented data logging in MT4 indicator (all the data is written correctly) as follows:

      Corr = GetCorrelation();
      Pos = iBarShift(Symbol(), Period(), Times[CurrPos]);
      Buffer[Pos] = NormalizeDouble(Corr,3);
//------
      datetime bar2 = iTime(Symbol1, 0, Pos);
      Print("Buffer[Pos]...",Buffer[Pos],"...bar2...",bar2);
      handle= FileOpen("kor.bin", FILE_BIN|FILE_READ|FILE_WRITE, ";");
      if(handle<1) Print("can't open file error-",GetLastError());
      if (handle>=1)
       {
        FileSeek(handle,0,SEEK_END);
        FileWriteDouble(handle,bar2,DOUBLE_VALUE); 
        FileSeek(handle,0,SEEK_END);
        FileWriteDouble(handle,Buffer[Pos],DOUBLE_VALUE); 
        FileClose(handle);
       }
//------
      CurrPos++;

But reading in mt5 by an EA remains the same:

double proverka()
{
 if (FileIsExist("kor.bin",0)==true) Print("ФАЙЛ ОБНАРУЖЕН = ...");
 handle= FileOpen("kor.bin", FILE_BIN|FILE_READ);
 if(handle < 0) Print("-----Неоткрывается :- Почему? Потому что произошла ошибка ",GetLastError());
 ulong file=FileSize(handle);
 ulong N = 0.0;
 double kor = 0.0;
 datetime bar[1];
 CopyTime(Symbol_1,NULL,0,1,bar);
 ulong New = (ulong) bar[0];
 while (N < file)
  {
   kor=FileReadDouble(handle); 
   N = FileTell(handle);
   //Print("1...kor=",kor,"N=",N,"file=",file,"New=",New);
   if (kor == New) 
    {
     double ss = FileReadDouble(handle);
     FileClose(handle);
     Print("2...ss=",ss);
     return (ss);
     break;
    }
   if (New < kor)
    {
     Print ("New=",New,"kor=",kor);
     return (0.0);
     break;
    }
  } 
 Print("ВСЕЕЕЕЕЕ",kor);
 FileClose(handle);
 return (kor);
}
//=

Is it possible for an EA in mt5 to open a file created in mt4 ?

Reason: