MT4 error 129: Invalid price (ERR_INVALID_PRICE)
The price in the request is stale, on the wrong side, or not normalized. Nothing was executed; refresh rates and resend.
What it means
You see this code in GetLastError() in MQL4, after a trade function fails on the server side.
The server didn't accept the open or close price. For a market order it must be the current Ask (buy) or Bid (sell), within the slippage you allow.
For pending orders the price must be on the correct side of the market.
Common causes
AskorBidused withoutRefreshRates()after a slow step.- A buy opened at
Bid, or a sell atAsk. - A price with too many decimals.
- A price calculated on another symbol's values.
How to fix it
- Call
RefreshRates()right before the send. - Normalize prices with
NormalizeDouble(price, Digits). - For other symbols, use
MarketInfo(sym, MODE_ASK)andMODE_BID.
Example in MQL4:
RefreshRates();
string sym = "GBPUSD";
int dg = (int)MarketInfo(sym, MODE_DIGITS);
double ask = NormalizeDouble(MarketInfo(sym, MODE_ASK), dg);
int ticket = OrderSend(sym, OP_BUY, 0.10, ask, 3, 0, 0, "", 4711);
if(ticket < 0) Print("error ", GetLastError()); Is it safe to retry?
Yes, with a fresh, normalized price.
Could the order have executed?
No. The server refused the price, so no order was opened, closed or changed.
How Tickwire handles it
Tickwire treats it like MT5 10015, and the MT4 code stays in the message. See trade results.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.