Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 976

 
How do I erase a line in a file? For example, I wrote something withFileWriteString(), and now I need an empty space in this space, how do I do this?
 
Alexandr Sokolov:
How do I delete a line in a file? For example, I wrote something with FileWriteString(), and now I need an empty space in this place, how do I do it?

access to file data is sequential access, you cannot just delete data anywhere in the file

 
Igor Makanu:

access to file data is sequential access, you cannot just delete data anywhere in the file

OK. And how can I delete it at all? Because I haven't seen the corresponding functions in the help, e.g. there's one for writing but no one for deleting

* except for replacing with "blank" - " "?

 
Alexandr Sokolov:

Okay. And how do you delete? Because I haven't seen corresponding functions in help, for example, there is one for writing but no one for deleting.

* except for replacing with "blank" - " "?

one more time... there is random data access and there is sequential data access

if it is sequential, you read/write in one direction as far as the file is concerned:

1. open and read - file pointer moved

2. open and write - file pointer moved, then write again - file pointer moved.....


You can move file pointer yourself FileSeek() and continue writing from this location.

You can open file for reading, read as many bytes as you need into memory and then close file again, reopen only for writing and dump what you read into the file, thus removing what you don't need and... and don't forget to add the data that came after the deleted fragment.


that's basically how file handling looks like. Look for an article on the forum, I think there should be one on file handling

 
Igor Makanu:

one more time... there is random data access and there is sequential data access

if it is sequential, you read/write in one direction as far as the file is concerned:

1. open and read - file pointer moved

2. open and write - file pointer moved, then write again - file pointer moved.....


You can move file pointer yourself FileSeek() and continue writing from this location.

You can open file for reading, read as many bytes as you need into memory and then close file again, reopen only for writing and dump what you read into the file, thus removing what you don't need and... and don't forget to add the data that came after the deleted fragment.


That's basically what working with a file looks like. Search for an article on the forum, I think there should be one on working with files

I'll look into it. I will look into it.

 

Guys, any thoughts?

 
Hi. I have a problem getting data from iMFI indicator.
double ifmi_indicator = iMFI(symb_pair_with_suffix, StringToInteger(duration), 10, 1);

This code is called on a timer, from another chart. One on which the EA is standing, I get the rest of the data from the code. The data from ifmi_indicator does not coincide with what I get in the terminal when viewing the indicator on this symbol on the current bar or on the previous bar. What is the problem? Sometimes the data I get is even stranger than the one I get while reviewing the chart manually. For example, I look at the value 20 but the code shows 70. What may be the problem?

The language is mql4.
 
How to add minutes to the indicator, only hours now.
Files:
 

Good afternoon!

I am interested in the Gator indicator. From the manual I understood that it is possible to extract values of upper and lower histogram lines. But I am more interested in the colour of the line and its value in the second place, only if the top and bottom lines are different colours. How do I extract the colour so that I can then compare the values of the green line and the red line?

 
novichok2018:

Good afternoon!

I am interested in the Gator indicator. From the guide I have understood that it is possible to extract values of upper and lower histogram lines. But I am more interested in the colour of the line and its value in the second place, only if the top and bottom lines are different colours. How do I extract the colour so that I can then compare the values of the green line and the red line?

If the current value is higher than the previous value, then it is green and the buffer is different, in mql4, and if the opposite is true, then ... vice versa.))))

Reason: