I don't know what the problem is but there is clearly no need for separate FileAppend functions. You are passing a new file name at the same time. Just one FileAppend function and using the unique names you have defined should be more than enough. Also the FileFlush immediately before the FileClose is redundant. The documentation explicitly says so.
I bet that if you remove the FILE_READ and the FILE_SEEK, leave the file open (but FileFlush after each write) it will just "magically" work.
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
Can someone help me with a FileWrite() problem? Initially I have had problems with writing large amounts of data to a single file as something caused the data file to be overwritten at a certain interval. In other words data was saved to a txt file and when the record count approached 27,598,602 records, the file was overwritten and the records resumed in the txt file at 27,598,603. Thinking that this problem may have something to do with large files, I wrote a program to save smaller record counts in many more files. In other words the EA was coded to write 20,000,000 records to a file and when this record count was triggered, a new file was started with record count 20,000,001. What I have noted is that the multiple data files continue to be overwritten with smaller record counts. Though my code is not perfect (ie. close the file after each write), I still have not solved the inherent problem of a file being overwritten. Does anyone know why this is occuring?
https://www.mql5.com/en/forum/137736