Camovia Tray™

Blog · Knowledge

MQL4 Comments: The Mistakes That Cost You Time (and How to Get Them Right)

Camovia Tray Team · 2026-09-16

When developers first start writing Expert Advisors in MQL4, comments often feel like the least important part of the job. You’re focused on logic, conditions, and making sure your OrderSend() executes correctly. Comments are an afterthought—if they’re thought about at all.

This is the first and most costly mistake.

The reality is that "comments in MQL4" isn’t a single concept. It’s actually three distinct tools, each with its own rules, limits, and pitfalls. Confusing them leads to lost time, misdiagnosed bugs, and strategies that are impossible to maintain.

Mistake 1: Treating All MQL4 Comments the Same Way

The term "comment" in MQL4 refers to three very different things:

Code comments (// and /* */) are for developers. They exist purely in your source code to explain what your EA does. These have no runtime overhead. You can be as verbose as you like on readability, though there is a practical limit—excessively large code comments can bloat your compiled .ex4 file size and potentially trigger compiler warnings .

The Comment() function is for charts. It displays a string in the top-left corner of your MT4 chart window. This is how you print real-time values—current price, spread, indicator readings—directly on the screen while your EA runs . The catch? It has a hard limit of 2045 characters . And calling it multiple times overwrites the previous output—you must build a single string with line breaks (\n) if you want multiple lines .

Order comments are for trade history. The comment parameter in OrderSend() attaches a text string to each trade . This is how you label orders so you can later filter your history and see which trades came from which strategy. The rule here is critical: once an order is closed, its comment is immutable—you cannot change it . Also, brokers may append or alter the last part of the comment, and the total length is often capped (e.g., 25 characters on some platforms) .

The mistake is assuming all three work the same way. They don’t.

Mistake 2: Using Comment() for Debugging Without a Strategy

Every MQL4 developer has done this: scatter Comment() calls throughout the code to track variables. The problem is that Comment() is a single-line display. If your EA enters multiple conditions simultaneously, your carefully placed debug messages will overwrite each other. You only see the last one .

The fix is simple: build a cumulative string.

string debugInfo = "";
if(condition1) debugInfo += "Condition1 triggered\n";
if(condition2) debugInfo += "Condition2 triggered\n";
Comment(debugInfo);

But there’s a deeper issue here. Comment() is a live display. It disappears when the chart refreshes or the terminal restarts. If you’re not watching at the exact moment something happens, you lose the information forever.

Mistake 3: Thinking You Can Go Back and Modify Trade Comments

This is perhaps the most frustrating limitation. Once a trade is placed with OrderSend(), you cannot change its comment later. The OrderModify() function does not allow you to alter the comment field—it only handles price, SL, TP, and expiration . If you want to add context to a trade after it’s opened, you can’t. You have to plan ahead.

This means your EA must generate the complete comment at the moment of trade execution. Include everything you might need later for analysis: the strategy name, entry signals, or even key price levels.

string orderComment = "Strategy_RSI_" + DoubleToString(entryPrice, Digits);
OrderSend(Symbol(), OP_BUY, lots, Ask, slippage, SL, TP, orderComment, magic, 0, clrGreen);

Once that trade closes, that comment is history—literally. It will be in your account history forever with whatever you wrote, so make it count.

Where Camovia Tray Fits

MQL4 comments help you understand what your EA is doing. But even with perfect comments, you still have to open the MT4 terminal to see them—whether it’s checking the Comment() output on a chart or reviewing trade history.

If you run multiple EAs across multiple charts, this means juggling windows, waiting for terminals to load, and constantly switching contexts just to check whether your trades are executing as expected. This is where Camovia Tray changes the experience. It turns your MT4 terminal into a system tray tool, allowing you to view open positions and live quotes directly from your system tray without ever bringing the MT4 window to the foreground.

And because it reads data directly from your local terminal, everything stays on your computer—your trade data, your comments, and your strategy information never leave your machine. It’s a fast, convenient way to monitor your EAs without disrupting your workflow or exposing your screen to prying eyes.

MT4/MT5 Tray Assistant

Silent tracking, one-click close - check quotes and manage positions right from the tray.

Download Camovia Tray

Frequently Asked Questions

Where are the privacy policy and user agreement?

The "Privacy" and "EULA" links in the footer of this site, with GDPR/CCPA information included.

What is Camovia Tray?

A tray assistant for MT4/MT5 - silent tracking, one-click close: hover the system tray to check the latest quotes and manage open positions (click an order to close it), hide the MT5/MT4 main window in one click, and keep quote and position data entirely on your computer.

Do I need MT5/MT4 installed? Does the terminal need to stay open?

Yes. Camovia Tray reads quote and position data from your locally running MT5/MT4 terminal, so the terminal must be installed, running, and logged in. MT5 connects directly with no EA; MT4 needs the bundled bridge EA attached once (one-click copy in Settings, then double-click in the Navigator - see the docs).

Are my quotes and positions uploaded anywhere?

No. Quote and position data is read 100% from your local MT5/MT4 terminal and never leaves your computer. See the privacy policy for details.

Popular Symbols Trading Hours

Open/close times, weekend hours & live market status: