What did Alert say?
What OS? If Vista or W7, look for files in virtual directories.
are you looking in correct folders?
tester\files
expert\files
The alerts said:
"File was open"
"16 Chars written"
So it seems that both the FileOpen and the FileWrite succeded.
I searched for the created file in the folder C:\Program Files\Fxglobe ECN MetaTrader 4.0 (I used a file search which includes sub-directories)
I also looked manually in the folders:
C:\Program Files\Fxglobe ECN MetaTrader 4.0\tester\files
C:\Program Files\Fxglobe ECN MetaTrader 4.0\experts\files
* I use a demo account
The alerts said:
"File was open"
"16 Chars written"
So it seems that both the FileOpen and the FileWrite succeded.
I searched for the created file in the folder C:\Program Files\Fxglobe ECN MetaTrader 4.0 (I used a file search which includes sub-directories)
I also looked manually in the folders:
C:\Program Files\Fxglobe ECN MetaTrader 4.0\tester\files
C:\Program Files\Fxglobe ECN MetaTrader 4.0\experts\files
* I use a demo account
Hello,
You can inspire it works only in writing.
Compile it, run it from the browser MT4 which was summarized,
look in the program file FXCM> Experts> Files ...
Cordially //+------------------------------------------------------------------+
Thanks for the code Cordially. When I use it as an EA and I get alerts saying: "No file named trading.txt"
It seems that the file is not created. The directories:
C:\Program Files\Fxglobe ECN MetaTrader 4.0\experts\files
and
C:\Program Files\Fxglobe ECN MetaTrader 4.0\tester\files
are still empty.
I found the problem. Windows 7 prevent writing to some directories (such as program files or system directories) for non administrator users (though my user has administrator privilages).
I needed to right click on the program's exe file and choose "Run as administrator". That solved the issue! :)
Thanks for trying for help!
How to change the Default saving directory to c:\csv ?.
I found the problem. Windows 7 prevent writing to some directories (such as program files or system directories) for non administrator users (though my user has administrator privilages).
I needed to right click on the program's exe file and choose "Run as administrator". That solved the issue! :)
Thanks for trying for help!
Hi Sip,
Can you tell me the name of the exe file that needs to be granted "Run as administrator"?
Thanks,
Lars.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I got a problem using FileOpen and FileWrite. The functions FileOpen and FileWrite seem to work (returns positive return val) but no file is created... see code below
I'll be gratefull for help.
code:
int outFile = FileOpen("testFileOpen.csv",FILE_CSV|FILE_WRITE,',');
if (outFile<=0){
Alert("File was not opened ");
}
else{
Alert("File was opened ");
int charsWritten = FileWrite(outFile,"test file write");
if (charsWritten <=0)
Alert("Cant write to file");
else
Alert(charsWritten," Chars written");
FileClose(outFile);
}