Just used your code and it works here is the output
2010.09.23 20:56:20;132.51;132.561;143
2010.09.23 20:56:29;132.505;132.556;144
2010.09.23 20:56:30;132.5;132.551;145
2010.09.23 20:56:30;132.504;132.555;146
2010.09.23 20:56:32;132.508;132.559;147
2010.09.23 20:56:40;132.512;132.563;148
2010.09.23 20:56:47;132.503;132.547;149
2010.09.23 20:56:48;132.48;132.531;151
2010.09.23 20:56:49;132.472;132.523;152
2010.09.23 20:56:52;132.476;132.527;153
You problably dont know here to look for the file, it is on the metatrader \expert \ files folder
Just used your code and it works here is the output
2010.09.23 20:56:20;132.51;132.561;143
2010.09.23 20:56:29;132.505;132.556;144
2010.09.23 20:56:30;132.5;132.551;145
2010.09.23 20:56:30;132.504;132.555;146
2010.09.23 20:56:32;132.508;132.559;147
2010.09.23 20:56:40;132.512;132.563;148
2010.09.23 20:56:47;132.503;132.547;149
2010.09.23 20:56:48;132.48;132.531;151
2010.09.23 20:56:49;132.472;132.523;152
2010.09.23 20:56:52;132.476;132.527;153
You problably dont know here to look for the file, it is on the metatrader \expert \ files folder
the file looks empty because before you open the file you need to removed the indicator from the chart or closed metatrader, the reason is because you have the file closed on the deinit () and if you try to open the file with the indicator running you get a file ascess error.
if you still have this problem is because the file is damaged, close metatrader delete all the files form the FILES forlder open metatrader run your expert and the closed metatrader again and check the file
int deinit() { //---- // Close the file FileClose(file); //----
return(0);
the file looks empty because before you open the file you need to removed the indicator from the chart or closed metatrader, the reason is because you have the file closed on the deinit () and if you try to open the file with the indicator running you get a file ascess error.
if you still have this problem is because the file is damaged, close metatrader delete all the files form the FILES forlder open metatrader run your expert and the closed metatrader again and check the file
return(0);
hi I'm not sure to understand. Finally when I delete the indicator THEN only the data is written to the file. But that's not what I want: I want the data to be written in real time. Is it because of the buffer maybe ?
You wait 1024 ticks before you force the data to the file (flush)
Are you waiting that long to see if it "works"?
You wait 1024 ticks before you force the data to the file (flush)
Are you waiting that long to see if it "works"?
You wait 1024 ticks before you force the data to the file (flush)
Are you waiting that long to see if it "works"?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My indicator below only creates a blank file: