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.

4301ERR_MARKET_UNKNOWN_SYMBOL
After a fixSafe to retry?
NoCould it have executed?

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, EURUSDm or #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 MT5 Python functions

All MetaTrader error codes

One API for MT4 and MT5

Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.