Skip to content

Trade server return code

10025 TRADE_RETCODE_NO_CHANGES

No changes: a modification that changes nothing

What it means

The request asks to set the stop loss, take profit or order price to the values they already have. MetaQuotes lists it among the checks for Market products ("Sending a request to modify the levels without actually changing them"). In MQL4 the same mistake returned error 1.

Common causes

  • A trailing or break-even routine that sends the modification on every tick, even when the level did not move.
  • Comparing an unnormalised computed price with the stored one, so they look different but round to the same value.
  • Code that "re-applies" stops after a restart without reading the current ones.

A real scenario

A break-even routine moves the stop to the open price once the trade is 20 pips in profit, and then keeps sending the same modification on every tick. Each one returns 10025, and the flood of identical requests later triggers 10024 on the broker's side. Comparing the normalised new level with the current one before sending removed both.

How to fix it

  1. Normalise the new levels to the symbol's digits.
  2. Compare them with the position's current POSITION_SL and POSITION_TP; if both are equal within half a point, send nothing.
  3. Treat "nothing to change" as success in your own code.

Fixed MQL5 code

MQL5
#include <Trade/Trade.mqh>
CTrade trade;


bool ModifyIfChanged(const ulong ticket, double sl, double tp)
{
   if(!PositionSelectByTicket(ticket))
      return false;
   sl = NormalizeDouble(sl, _Digits);
   tp = NormalizeDouble(tp, _Digits);
   double half = _Point / 2.0;
   bool slSame = MathAbs(sl - PositionGetDouble(POSITION_SL)) < half;
   bool tpSame = MathAbs(tp - PositionGetDouble(POSITION_TP)) < half;
   if(slSame && tpSame)
      return true;                       // nothing to change: do not send a request
   return trade.PositionModify(ticket, sl, tp);
}

A focused example for MetaTrader 5: adapt names, magic number and limits to your EA, and test it on a demo account first.

EA Doctor rules that catch it

Sources

Get your EA fixed

Still failing with 10025? Send us the EA and the journal lines: we find the cause in the code and fix it. Or check it yourself first with the EA Doctor.