MT4 error 2: Common error (ERR_COMMON_ERROR)

MT4's catch-all trade error. It doesn't say whether the order executed, so check open orders and history before sending again.

2ERR_COMMON_ERROR
Check firstSafe to retry?
MaybeCould it have executed?

What it means

You see this code in GetLastError() in MQL4, after a trade function fails on the server side.

Error 2 is MT4's general failure answer for a trade request. It gives no detail.

Because the reason is unknown, you can't assume the broker did nothing.

Common causes

  • A problem on the broker's server.
  • A request the server refused without a specific code.
  • A connection problem during the request.

How to fix it

  • Check open orders and the account history for your magic number before any retry.
  • Look at the terminal's Journal for more detail.
  • If it repeats on valid requests, ask the broker.

Example in MQL4:

// After an unclear answer: did the order open anyway?
int FindMine(const string sym, const int magic, const string tag)
{
   for(int i = OrdersTotal() - 1; i >= 0; i--)
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)
         && OrderSymbol() == sym && OrderMagicNumber() == magic
         && OrderComment() == tag)
         return OrderTicket();
   return -1;
}

int ticket = OrderSend(Symbol(), OP_BUY, 0.10, Ask, 3, 0, 0, "job-4711", 4711);
if(ticket < 0)
{
   int err = GetLastError();
   if(err == ERR_COMMON_ERROR)
   {
      Sleep(2000);
      RefreshRates();
      int found = FindMine(Symbol(), 4711, "job-4711");
      Print(found > 0 ? "It opened: ticket " + IntegerToString(found) : "No trace yet; check history before resending");
   }
}

Is it safe to retry?

Only after you have checked the account.

Could the order have executed?

Maybe. Error 2 doesn't tell you.

How Tickwire handles it

On a send, close or delete, Tickwire treats it like MT5 10031: no resend, it looks for the effect and reports applied, rejected or unknown. The MT4 code stays in the message.

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.