MetaQuotes:
Sounds like a worthy pursuit especially for back testing and optimization.
Check out the new article: Mastering Log Records (Part 4): Saving logs to files.
Author: joaopedrodev

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
Check out the new article: Mastering Log Records (Part 4): Saving logs to files.
In this article, I will teach you basic file operations and how to configure a flexible handler for customization. We will update the CLogifyHandlerFile class to write logs directly to the file. We will conduct a performance test by simulating a strategy on EURUSD for a week, generating logs at each tick, with a total time of 5 minutes and 11 seconds. The result will be compared in a future article, where we will implement a caching system to improve performance.
In the first article of this series, Mastering Log Records (Part 1): Fundamental Concepts and First Steps in MQL5, we embarked on the creation of a custom log library for Expert Advisor (EA) development. In it, we explored the motivation behind creating such an essential tool: to overcome the limitations of MetaTrader 5’s native logs and bring a robust, customizable, and powerful solution to the MQL5 universe.
To recap the main points covered, we laid the foundation for our library by establishing the following fundamental requirements:
With this well-established foundation, it became clear that the logging framework we are developing will be much more than a simple event log; it will be a strategic tool for understanding, monitoring and optimizing the behavior of EAs in real time.
So far, we've explored the basics of logs, learned how to format them, and understood how handlers control the destination of messages. But where do we store these logs for future reference? Now, in this fourth article, we'll take a closer look at the process of saving logs to files. Let's get started!
Author: joaopedrodev