Errors, bugs, questions - page 477

 
stringo:

In your case, you need to use dynamic arrays

Thank you! It works.

 

Correct, if not difficult, the error in the tester.

Experts are blind when processing a tick. It is impossible to update the information on a symbol during tick processing.

In normal trading this does not happen and all data are updated.

https://www.mql5.com/ru/forum/4270/page2#comment_87059

Without this fix it is impossible to process trade errors correctly.

RefreshRates() внутри OnTick()
RefreshRates() внутри OnTick()
  • www.mql5.com
Если это невозможно, то как проще всего реализовать обработку ошибок торговых операций с проверкой котировок на обновление?
 

When, during optimisation, all trades are on the plus side, the xml report file is crooked.

... Please correct it.

 

Either I don't understand something, or you forgot to make FileClear() function

Now, as I understand it, to clear a file you have to 1 close, 2 delete, 3 open. - This is very inconvenient.

 
vyv:

Either I don't understand something, or you forgot to make FileClear() function

Now, as I understand it, to clear a file you have to 1 close, 2 delete, 3 open. - This is very inconvenient.

Why do you need to clear a file? You move the file pointer to 0 and start writing.
 
stringo:
Why clear the file? Move the file pointer to 0 and start writing.
If there are 5 lines in the file. I want to write 3 instead. I move the pointer to the beginning of the file, write 3.... And behind them there are 2 more... So there are 5 lines in the file instead of 3 - shield...
 
vyv:
If there are 5 lines in the file. I want to overwrite them with 3. I move the pointer to the beginning of the file, write 3.... And there are 2 more behind them... So there are 5 lines in the file instead of 3 - a shield...

Open a file with write-only flag FILE_WRITE and write whatever you want. Everything before that will be deleted.

There are some peculiarities of working with read and write flags:

  • If FILE_READ is specified, an attempt is made to open a file that already exists. If the file does not exist, the file cannot be opened, a new file is not created.
  • If FILE_READ|FILE_WRITE - a new file is created if there is no file with that name.
  • If FILE_WRITE - the file is re-created with zero size.
 

It looks like the FileChangeSize function is needed

 
The WinAPI has the SetEndOfFile function
 
stringo:

The FileChangeSize function seems to be needed

And they also forgot the file/folder renaming functions.

// OK, I agree, you can rename with FileMove(...), but for folders we need an analog too. :)