MT5 error 4302: Symbol is not selected in Market Watch (ERR_MARKET_NOT_SELECTED)
The symbol exists but isn't in Market Watch, so its prices and some properties aren't available. Select it first.
4302ERR_MARKET_NOT_SELECTED
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 terminal only streams prices for symbols shown in Market Watch. Asking for live data on a symbol that exists but isn't selected fails with 4302.
It is easy to fix and common in code that trades many symbols.
Common causes
- A symbol that was never added to Market Watch.
- A symbol removed from Market Watch by hand or by another program.
- A fresh terminal profile with only a default list of symbols.
How to fix it
- Call
SymbolSelect(name, true)before you read prices or trade. - In Python,
mt5.symbol_select(name, True)does the same. - Wait for the first tick after selecting before you send an order.
Example in MQL5:
bool Ready(const string sym)
{
if(!SymbolInfoInteger(sym, SYMBOL_SELECT) && !SymbolSelect(sym, true))
{
Print("Could not add ", sym, " to Market Watch, error ", GetLastError());
return false;
}
MqlTick t;
return SymbolInfoTick(sym, t) && t.time > 0; // a price has arrived
} Is it safe to retry?
Yes, after selecting the symbol.
Could the order have executed?
No. The call failed before any trade.
Related codes
- MT5 error 4301: Unknown symbol (ERR_MARKET_UNKNOWN_SYMBOL)
- MT5 error 10021: No quotes to process the request (TRADE_RETCODE_PRICE_OFF)
- MT5 Python error -4: Not found (RES_E_NOT_FOUND)
Related MT5 Python functions
- mt5.symbol_info() in MetaTrader5 Python: read a symbol's settings and limits
- mt5.symbol_info_tick() in MetaTrader5 Python: get the latest bid and ask
- mt5.symbol_select() in MetaTrader5 Python: add a symbol to Market Watch
- mt5.copy_rates_from() in MetaTrader5 Python: get bars back from a date
- mt5.copy_ticks_from() in MetaTrader5 Python: get ticks forward from a date
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.