MT5 error 4301: Unknown symbol (ERR_MARKET_UNKNOWN_SYMBOL)
The terminal doesn't know a symbol with this name. Brokers often add suffixes such as .m or .pro, so check the exact name.
What it means
You see this code in GetLastError() in MQL5, after a function fails.
The name you passed doesn't match any symbol the broker offers on this server. Names are exact and case sensitive.
The same instrument often has a different name at each broker, and sometimes on each account type at one broker.
Common causes
- A suffix or prefix used by the broker, such as
EURUSD.m,EURUSDmor#AAPL. - A typing mistake or the wrong case.
- A symbol name taken from another broker or another account type.
- A symbol the broker has removed.
How to fix it
- List the symbols the server offers and match on what you need.
- Keep a per-account map from your own names to the broker's names.
- Check the name once at start up, not on every order.
Example in MQL5:
// Find the broker's name for EURUSD, whatever suffix it uses.
string FindSymbol(const string base)
{
for(int i = 0; i < SymbolsTotal(false); i++)
{
string name = SymbolName(i, false);
if(StringFind(name, base) == 0) return name;
}
return "";
} Is it safe to retry?
Only with the correct name.
Could the order have executed?
No. Nothing can be traded on a symbol the terminal doesn't know.
How Tickwire handles it
Tickwire checks the symbol before sending a trade. An unknown symbol comes back as numericCode 4301 with nothing sent. On read routes it is symbol_not_found.
The symbol list for an account is in the API, so you can map names once. See the reference.
MT4 runtime error 4106 is the same problem on MT4.
Related codes
- MT5 error 4302: Symbol is not selected in Market Watch (ERR_MARKET_NOT_SELECTED)
- MT4 error 4106: Unknown symbol (ERR_UNKNOWN_SYMBOL)
- MT5 error 10013: Invalid request (TRADE_RETCODE_INVALID)
Related MT5 Python functions
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.