Discussing the article: "Mastering Log Records (Part 7): How to Show Logs on Chart"

 

Check out the new article: Mastering Log Records (Part 7): How to Show Logs on Chart.

Learn how to display logs directly on the MetaTrader chart in an organized way, with frames, titles and automatic scrolling. In this article, we show you how to create a visual log system using MQL5, ideal for monitoring what your robot is doing in real time.

In the first article of this series, Mastering Logging (Part 1): Fundamental Concepts and Getting Started in MQL5, we took the first steps in building this library. We explored the fundamentals, discussed why blindly relying on standard MetaTrader logs is an invitation to chaos, and began to shape a robust, customizable, and scalable solution.

And it was precisely in the middle of this process that I came across an idea that, honestly, was not even in the roadmap. While using the library myself, I realized over time how uncomfortable it is to hunt for logs in the terminal, open the Experts tab, filter messages amidst noise, or worse: miss a critical error because it disappeared from the screen in the middle of execution. It's that classic: looking for a needle in a haystack... while the haystack is on fire.

That's when it hit me: "What if these logs were where they really make sense? On the chart, in front of the trader's face, where the robot lives and breathes" And look, I'm not talking about drawing scattered labels, blinking arrows or graphic objects that clutter more than they help. I'm talking about something much more elegant, discreet and functional: using the good old Comment().

Yes, that function that most people solemnly ignore, use only to debug a variable and then delete it. Well, with a little creativity it can be transformed into a clean, readable, real-time updated and absurdly useful log console.

And so it doesn't sound like a salesman's talk, just take a look at this in action:

Author: joaopedrodev