MT5 error 10029: Order or position frozen (TRADE_RETCODE_FROZEN)
The price is too close to the order or stop you want to change, inside the freeze level. Nothing changed; wait for the price to move away.
What it means
You see this code in the retcode of a trade result, from OrderSend() in MQL5 or order_send() in Python.
When the market gets within the symbol's freeze level of a pending order's price, or of a position's stop loss or take profit, the server freezes it. You can't modify, delete or close it in that zone.
The freeze stops last moment changes just before a level is hit.
Common causes
- Moving a stop loss that the price is about to reach.
- Deleting a pending order that is about to trigger.
- A symbol with a large
trade_freeze_level, often around news.
How to fix it
- Read
trade_freeze_leveland check the distance before sending. - Wait for the price to move away, or let the level be hit.
- Make trailing logic skip updates inside the freeze zone.
Example in Python:
import MetaTrader5 as mt5
s = mt5.symbol_info(pos.symbol)
tick = mt5.symbol_info_tick(pos.symbol)
freeze = s.trade_freeze_level * s.point
close_px = tick.bid if pos.type == mt5.POSITION_TYPE_BUY else tick.ask
if pos.sl and abs(close_px - pos.sl) <= freeze:
print("stop is inside the freeze zone; try again later") Is it safe to retry?
Yes, once the price is outside the freeze zone.
Could the order have executed?
No. Your change was not applied. The order or position is as it was.
How Tickwire handles it
MT4 error 145 (modification denied, too close to market) comes back as 10029.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.