"Write to file" block
-
Hello
Please, could anyone explain where is saved the csv file written by the "Write to file" block? Because I used the Desktop path but it looks like nothing is written.

Thanks
-
in Metatrader program select File - Open Data Folder
when EA is running in tester:
- tester\files
when EA is running in chart:
- MQL4\files
relative path means, you can add a subfolder path to the file
-
Hello @miro1360
Thanks for your help.
It looks like that is not working for me (MT5). I have checked the paths you suggested but I am not getting the file.
My EA just looks for candles with a long upper o bottom wick. I have used your "candle formations" tutorial for the EA's search base. When it finds a candle, it should write some values to the file. The EA is working pretty well because it draws an arrow when it finds a candle.


But I am not able to find the files that should be written if they are written.
Could take a look and let me know what I am doing wrong?
https://fxdreema.com/shared/YAUDRX5L
Thanks
-
the location for MT5 tester is:
C:\Users\username\AppData\Roaming\MetaQuotes\Tester\subfolder\Agent-xxx\MQL5\Files
crazy path ... -
-
@josecortesllobat I'm having a similar problem with that function. I have no difficulty finding the file but when I open the file I just get one row of data. Isn't it supposed to store the data into different rows each time?
-
Yes, it is.
Here you have how it looks like after importing the CSV file into Excel

My EA is looking for some specific candles and stores some properties



-
Thanks a lot for your quick reply. Here is what I have but it keeps saving only the last value. https://fxdreema.com/shared/PyUf65OJ
Could you please tell me What mistake I'm making here? -
-
I just did what you suggested but the result is the same I think I need to have more than those blocks. When I look at your EA I also see some additional blocks but I'm not sure about their functions. Sorry for taking up your time and thanks a lot.
-
Hello @kerrre
I think it might be a bug with the "Write to file" block and we need that admin takes a look at this. Because I have my old EA working correctly but I compile it again and it does not work.




With the new compilation, the csv file only contains one record like what you are getting with your project.
-
Hello @fxDreema
We need that you take a look at "Write to file" block. It looks like it is not behaving correctly.
Thanks
-
@josecortesllobat Hi, I've the same problem with the "write to file" block today. @fxDreema can you take a look and fix the block?
-
Write to file was recently upgraded.
You might want to delete the file you have and try again.
Make sure the append option is set properly. -
What is the problem, only one row of data?
-
Yes. It keeps storing the data in the same row.
-
@fxDreema only one row of data is stored, the last one. Instead of a file with, let's say, a hundred rows, the output file only have one row, always.
-
@richard96816 I did it but just one row is stored with the new compilation of the same EA
-
Yes it is. Only one row is stored. As @richard96816 said, it might be an issue related with the last update of the block because it works as expected in a project compiled some time ago.
Thanks for taking a look at this.
-
I see. Yes, I made some update before and it looks that I did it wrong. I removed flag FILE_READ, because we only write there, but without that flag the file is always overwritten. I think I fixed it





