![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Do you want to:
1. Truncate the file - clear it out - make it empty - 0 bytes. ?
OR
2. Rename the name?
OR
3. Deleted only the information that was read from the file - but it looks like you are reading all of it so that would be the same as 1. ?
3. Deleted only the information that was read from the file - but it looks like you are reading all of it so that would be the same as 1.
i want just read one information After that delete information
And how does the information come into the file ? Does the file get more information from somewhere else while the EA is running?
Deleting from the beginning of a file is not efficient nor easy - better option might be to keep the file open all the time - and just read the next lot of information on the next tick. - FileOpen in OnInit , FileClose in OnDeInint...
but if the file is being updated from another source at the same time look at shared files, or name pipes.
Also think about how much information is read for each tick?
i want to read one information every tick and when finish delete the content after that Repeat the process every Tick
Repeat what?
If you have deleted the content, then the next tick there is nothing to read.
ydrol already asked you.....
And how does the information come into the file ?
Sorry I cant help much more without answers to earlier questions. Reading a single line and deleting every tick sounds like a bad design. Just keep the file open all the time and read the next record.
Your earlier code also looked like it was reading the entire file in one go. Change it to only read one item ?
Indeed. Opening, Deleting and then Closing a file every tick is a bad idea. This will result in heavy I/O on the filesystem. Specially if you run other things in the background or do bigger file movements, then this will probably give bad performance. Also think about the "tick" itself. On real volatile days e.g. when price movement goes up and down withing a short period then you might be getting plenty of ticks in a short period. Now imagine this not only with 1 chart open but with 10 charts running simultaneously.