Errors, bugs, questions - page 2234

 
Stanislav Korotky:

On this simple script, run first with writing = true and then on another chart with writing = false, I get an error.

Obviously it's a bug, because third-party applications read the file with the same flags without any problems.

 
Stanislav Korotky:

PS. Maybe someone has already written to the SR? What are the answers?

I wrote two years ago - application without movement. Please write again
 
A100:
I wrote two years ago - application without movement. Please write again.

What is the application number?

 
Spammed
Result.retcode = 10026
Result.comment = AutoTrading disabled by server 0.035 ms
OrderCheck returns true.
 
Alexander:

What is the application number?

Open, Started: 2016.08.04 02:13, #1530548


By the way... why did the links stop working?

Description of the problem

here https://www.mql5.com/ru/forum/1111/page1648#comment_2702870 with pictures

And now this link looks like this:

https://www.mql5.com/ru/forum/1111/page1628#comment_2702870

Now started checking - all links in applications lead to nowhere... it was fine before... The links were absolute. Now I understood only by the date that the link refers to this requisition

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2016.08.24
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы
 
A100:

By the way... why have the links stopped working?

Description of the problem

here https://www.mql5.com/ru/forum/1111/page1648#comment_2702870 with pictures

and now the link looks like this:

https://www.mql5.com/ru/forum/1111/page1628#comment_2702870

Now I've checked - all links in applications lead to nowhere... it was fine before... The links were absolute. Now I understand only by the date that the link refers to this application

It's been 20 pages in this thread for a long time.

 
fxsaber:

It's been going on for 20 pages in this thread.

In the past it did too, but the links worked (the ending remains the same)... at least I could easily find posts from a year ago, but now the March links are broken
 
Stanislav Korotky:

On this simple script, run with writing = true and then on another chart with writing = false, I get an error.

Result of running the script:

2018.07.23 19:44:15.224 !00 (EURUSD,M1) handle=1
2018.07.23 19:44:17.824 !00 (EURUSD,M1) Closing
2018.07.23 19:44:34.874 !00 (EURUSD,M1) handle=1
2018.07.23 19:44:40.874 !00 (EURUSD,M1) Closing
2018.07.23 19:45:12.844 !00 (GBPJPY,H4) handle=1
2018.07.23 19:45:16.354 !00 (GBPJPY,H4) Closing

1. With writing = true

2. On the same chart with writing = false

3. on another chart with writing = false

The only change

void OnStart()
as it should be...

Accordingly instead of

    return INIT_FAILED;

left

    return;

and deleted.

  return 0;

as being unnecessary.


What's wrong?

 

I realised I had done the experiment wrong.

Here is the result of repeating it:

2018.07.23 20:07:52.316 !00 (EURUSD,M1) handle=1
2018.07.23 20:07:52.316 !00 (EURUSD,M1) writing=true
2018.07.23 20:08:13.216 !00 (GBPJPY,H4) handle=1
2018.07.23 20:08:13.216 !00 (GBPJPY,H4) writing=false
2018.07.23 20:08:20.316 !00 (EURUSD,M1) Closing
2018.07.23 20:08:25.416 !00 (GBPJPY,H4) Closing

Your error is that after writing to a file, the data only gets to disk after FileClose OR after forcibly resetting the data to disk by FileFlush

Otherwise how can you read a file that doesn't exist???

And yet I added a flag

void OnStart()
{
  int handle = FileOpen("xyz.foo", FILE_READ|FILE_SHARE_WRITE|FILE_BIN|FILE_SHARE_READ|(writing?FILE_WRITE:0));
  if(handle == INVALID_HANDLE)
  {
    Print("FileOpen failed: ", GetLastError());
    return;
  }
  
  if(writing)
   {
    FileWriteInteger(handle, 0);
    FileFlush(handle);
   }
  
  Print("handle=", handle);
  Print("writing=", writing);
  
  while(!IsStopped())
  {
    Sleep(1000);
  }

  Print("Closing");
  FileClose(handle);

}/*******************************************************************/
Документация по MQL5: Файловые операции / FileFlush
Документация по MQL5: Файловые операции / FileFlush
  • www.mql5.com
При выполнении операции записи в файл физически данные могут оказаться в нем только через некоторое время. Для того чтобы данные сразу же сохранились в файле, нужно использовать функцию FileFlush(). Если не использовать функцию, то часть данных, еще не попавших на диск, принудительно записывается туда только при закрытии файла функцией...
 

How can last-price not be a multiple of TickSize?

SymbolInfoDouble(Symb,SYMBOL_TRADE_TICK_SIZE) = 0.05
Tick.last = 14.16