CSV file creation exampleExpert - MetaTrader 4 Expert - MT4/MT5 Resources
Hi everyone, I'm Lucas and I thought I'd contribute something to this wonderful community, I've learned a lot from reading informative articles and such. Well myself, Forex and stock market investor, I am just an expert in coding for my personal trading. This is my contribution and I hope some of you can take advantage of this expert;
Here is an example of how to write order data to a csv file that you can study and use later in your analysis. This Expert Advisor should not be used for trading (as it is now), this example demonstrates how to implement and use this functionality in your own Expert Advisor, or you can continue to build and modify this Expert Advisor according to your own strategy.
The expert will open a trade in the selected direction, enter a TP/SL virtual closing order through the menu settings, and if "WriteCloseData" is set to true, a file will be created in which the order data (such as direction, profit/loss, price, etc.) will be stored in your terminal as a csv file.
Test this expert in the strategy tester, you can access this file from OpenDataFolder/tester/CSVexpert/CSVexample When you start the test, the directory CSVexpert will be created along with the files that store all the data created by CSVexample in it.
When you implement this function to your own expert or continue building on it and run it later on a demo/real account, you will access this created file from MQL4/Files/CSVexpert/CSVexample
You can rename the directory and file names to anything you want, except leave the .csv as-is. Again, please note that this is just an expert example of what you can do with it and how to use this feature, because I don't want you to lose any money if you think it can be used for trading purposes now!
Attachment download
📎 csvexampleexpert.mq4 (6.08 KB)
Source: MQL5 #31964
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •