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 TrayFrequently 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.
Online Tools
Popular Symbols Trading Hours
Open/close times, weekend hours & live market status:
Related Articles
XAUUSD Trading Time Exness: A Practical Guide to Session Timing and Market Access
XAUUSD trading time on Exness explained: rollover windows, session overlaps, and daily breaks—plus how Camovia Tray helps you check gold quotes and manage positions from the system tray.
What Time Does USOIL Market Open in India? A Complete Guide for Traders
USOIL market open time in India is 6:30 PM IST (7:30 PM during US standard time). Learn USOIL market hours, close time, and Pakistan timing—plus how Camovia Tray helps you monitor positions from the system tray.
How Much Money Do You Need to Start Trading Gold?
Minimum capital for gold trading is set by margin plus stop distance. Work out the smallest XAUUSD account, and Camovia Tray keeps margin and equity visible.
Eurex Closing Time: A Trader's Guide to the Exchange's Daily Rhythm
Eurex closing time is 22:00 CET—learn how the exchange's daily schedule, holiday hours, and extended sessions work, and how Camovia Tray helps MT5/MT4 traders monitor quotes and positions from the system tray.
What Is MT5 Trading Platform? Common Misconceptions and What Traders Actually Need to Know
Turn your MT5 into a tray tool with Camovia Tray. Check quotes, manage positions, and hide the main window—all from the system tray, with local-only data.
More Articles
What Is the Next Short Squeeze Stock Like GameStop? And Why Most Traders Get the Setup Completely Wrong
Discover the next short squeeze stock like GameStop and why most traders miss the setup. Camovia Tray helps you monitor live quotes and manage positions from the system tray—without interrupting your workflow.
Does MT5 Work on Mac? What Traders Actually Need to Know
MT5 runs on Mac through Wine or alternatives—but daily use has trade-offs. What to expect, and how to keep quotes handy from your tray.
What Are XAUUSD Trading Hours? Clearing Up the Most Common Misconceptions
Meta description: Confused about XAUUSD trading hours? Learn the real gold market schedule, broker variations, and session overlaps—plus how Camovia Tray helps you monitor MT5/MT4 gold quotes and positions from the system tray.
XAUUSD Forex Trading Hours: When Does the Gold Market Actually Open?
Track XAUUSD trading hours across London, New York, and Asian sessions. See when gold moves most, how broker times differ, and how Camovia Tray helps you follow the market from your system tray.
COMEX Market Close Time: A Complete Guide to COMEX Exchange Hours
COMEX market close time explained: daily and weekly COMEX closing time, exchange opening time and COMEX futures trading hours, plus how Camovia Tray helps you track positions from the system tray.