All posts

Diagnostics

The bot didn't take the trade: reading the MT5 log

9 August 2026 · 6 min read · King Trading Zone

MetaTrader tells you exactly why an order failed. It just does it in a tab most traders never open, in the form of a four or five digit number. Learning six of those numbers turns an afternoon of guesswork into a thirty-second answer.

Two tabs, two different stories

The Toolbox has a Journal tab and an Experts tab. Journal is the terminal talking about itself: logins, disconnections, updates, orders accepted by the server. Experts is your EA talking: initialisation, its own print statements, and the result of every order it tried to send. When a trade is missing, start in Experts, then check Journal for the same timestamp to see whether the terminal was even connected.

The codes worth memorising

A rejected order writes a code. A filtered trade writes nothing at all. Silence is information too.

When there is no error at all

If the Experts tab shows initialisation and then nothing, the EA never attempted an order. That means one of its own conditions said no: a time filter, a spread filter, a maximum-positions limit, a news pause, a day-of-week setting. Most decent bots will print the reason if you enable their logging or verbose input. Turn it on for a day, read what it says, then turn it off so the file does not grow forever.

Turn on the numbers you will need later

Under Tools, Options, Expert Advisors, there is little to configure, but two habits pay for themselves. Keep the Experts log for at least a month, and take a screenshot of any unfamiliar code with the surrounding five lines. Codes on their own are ambiguous. Codes with a timestamp, a symbol and a lot size are diagnosable.

What to send when you ask for help

Account number, broker and server name, the exact symbol from the chart title, the last twenty lines of the Experts tab, and the EA's input list. With those five things a problem is usually solved in one message instead of ten.

Logs on a VPS

The files live under the terminal's data folder, in MQL5/Logs for EA output and Logs for the terminal. Open the data folder from File, then Open Data Folder — do not go looking in Program Files, because the running copy is almost never there. On a VPS, copy the day's log out before you restart anything; a fresh session makes the evidence harder to find.

The habit

Read the log on a normal day, not only on a bad one. You learn what healthy output looks like for your bot, and the first line that does not belong becomes obvious instead of alarming.

Stuck on an error code? Send the log lines over.

Message on WhatsApp

Keep reading

More from the journal

Portfolio

Running two bots on one account without them fighting

Magic numbers are the easy part. Shared margin, stacked exposure and correlated pairs are what actually blow the account up.

6 min read 5 August 2026
Timing

Your broker's clock is not your clock

Server time, GMT offset and two daylight-saving shifts a year. Every time-filtered bot drifts by an hour and nobody notices.

5 min read 1 August 2026
Crypto

What changes when a bot trades crypto instead of forex

The market never closes, so the risks move somewhere else: contract sizes, weekend liquidity, funding costs and maintenance windows.

6 min read 30 July 2026