Quick Answer
Trade return code 10025 (TRADE_RETCODE_NO_CHANGES, "No changes in request") means that you asked the server to change something to the value it already has. The usual case is a stop loss or take profit modify with the same price as the one on the position. The server has nothing to do, so it answers with a code and not with "done".
Most of the time this is not a real failure. It is a sign that the EA sends modify requests it does not need, typically a trailing stop or a break-even rule that runs on every tick. The fix is to compare the wanted stop with the current stop before you send, and to send only when they differ by at least one price step. The sections below show the comparison, the rounding that makes it reliable and an EA that prints the decision without sending anything.
From the author: I build and convert Expert Advisors. 10025 is the code that fills the log of a trailing stop that "works": the stop is already where the rule wants it, and the EA keeps asking. It is harmless for the account, but it hides the real errors in a long log, and it adds requests that you do not need to send.
Key Facts
| What you see | Usual cause | Fix |
|---|---|---|
| 10025 on a modify, many times in a row | The EA sends the same stop on every tick | Compare the wanted stop with the current one first |
| 10025 after a break-even move | The stop is already at the entry price | Check if the stop is already at the target |
| 10025 that looks random | The two prices differ by a rounding error | Round both to the tick size and compare with a tolerance |
| 10025 after a restart | The EA recalculates the same stop | Same fix: compare before sending |
| 10025 together with 10016 | A mix of "no change" and "too close" | Handle each code on its own |
What the Error Looks Like
With CTrade, a modify that changes nothing makes the call return false, and the code is in the result:
if(!trade.PositionModify(ticket, newSl, newTp))
{
PrintFormat("Modify failed. Retcode %u: %s",
trade.ResultRetcode(), trade.ResultRetcodeDescription());
}
With OrderSend, the code is in MqlTradeResult.retcode. A log full of 10025 on a modify line means that the EA modifies more often than it needs to. The full list of codes is in MQL5 trade return codes.
Why It Happens in a Trailing Stop
A trailing stop usually computes a wanted stop on every tick, for example "the bid minus 200 points", and sends a modify if the wanted stop is better than the current one. Two things go wrong:
- The check is missing, or it uses
>=and not>. The wanted stop equals the current stop, and the EA sends it again. - The check compares raw
doublevalues. The wanted stop has not been rounded to the tick size, so it differs from the current stop by a tiny amount, or the two values are the same price written with different rounding. The check says "different", the server says "no change".
The guide to a trailing stop EA shows the full structure of a trailing rule. This guide covers the one step that avoids sending a request that cannot change anything.
Step 1: Round the Price to the Tick Size
Prices on the server are multiples of the tick size. Round the wanted stop to that grid before you compare it, as in the invalid price guide:
double NormalizePrice(const string symbol, double price)
{
double tick = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);
int digits = (int)SymbolInfoInteger(symbol, SYMBOL_DIGITS);
if(tick <= 0.0)
return NormalizeDouble(price, digits);
return NormalizeDouble(MathRound(price / tick) * tick, digits);
}
The tick <= 0.0 check avoids a division by zero, as in MQL5 zero divide error.
Step 2: Compare With a Tolerance
Two prices are "the same" when they differ by less than half a tick. A tolerance is safer than == on double values:
bool SamePrice(const string symbol, double a, double b)
{
double tick = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);
if(tick <= 0.0)
tick = SymbolInfoDouble(symbol, SYMBOL_POINT);
return MathAbs(a - b) < tick / 2.0;
}
A stop of 0.0 means "no stop". Handle it on its own: if the position has no stop and you want one, that is a change, and SamePrice(0.0, 1.0834) is false, as it should be.
Step 3: Send Only When Something Changes
Put the two helpers in front of every modify call:
bool NeedsModify(const string symbol, double currentSl, double currentTp,
double wantedSl, double wantedTp)
{
bool slSame = SamePrice(symbol, currentSl, wantedSl);
bool tpSame = SamePrice(symbol, currentTp, wantedTp);
return !(slSame && tpSame);
}
and in the trailing rule:
double wantedSl = NormalizePrice(_Symbol, newStopFromRule);
double currentSl = PositionGetDouble(POSITION_SL);
double currentTp = PositionGetDouble(POSITION_TP);
if(NeedsModify(_Symbol, currentSl, currentTp, wantedSl, currentTp))
{
if(!trade.PositionModify(ticket, wantedSl, currentTp))
PrintFormat("Modify failed. Retcode %u: %s",
trade.ResultRetcode(), trade.ResultRetcodeDescription());
}
Select the position first (PositionSelectByTicket(ticket)) so that PositionGetDouble reads the right one. Also move the stop only in the direction that helps (up for a buy, down for a sell), and respect the minimum distance, as in invalid stops error 10016.
Step 4: Treat 10025 as "Nothing to Do", Not as an Error
Even with the check, a request can reach the server in a moment when the stop has just changed, for example after a manual change in the terminal. In your error handling, do not count 10025 as a failure and do not retry it:
if(retcode == TRADE_RETCODE_NO_CHANGES)
{
// the position already has these values: nothing to do, no retry
return true;
}
A retry of a request that changes nothing gives the same answer. Keep the retries and the cool-down for the codes that can be temporary, such as a request that the server rejected (10006) or a timeout. The list is in MQL5 trade return codes.
A Full EA That Prints the Decision
This EA does not place trades and does not modify anything. It checks a few example pairs of prices and prints what NeedsModify decides, and it prints the stop of the first position on the chart symbol, if there is one, and what the check says for the same stop and for a stop one tick better. Run it on a demo account:
#property strict
double NormalizePrice(const string symbol, double price)
{
double tick = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);
int digits = (int)SymbolInfoInteger(symbol, SYMBOL_DIGITS);
if(tick <= 0.0)
return NormalizeDouble(price, digits);
return NormalizeDouble(MathRound(price / tick) * tick, digits);
}
bool SamePrice(const string symbol, double a, double b)
{
double tick = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);
if(tick <= 0.0)
tick = SymbolInfoDouble(symbol, SYMBOL_POINT);
return MathAbs(a - b) < tick / 2.0;
}
int OnInit()
{
double tick = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
PrintFormat("%s tick=%g bid=%g", _Symbol, tick, bid);
double current = NormalizePrice(_Symbol, bid - 100 * tick);
PrintFormat("Same stop -> same=%s", SamePrice(_Symbol, current, current) ? "true" : "false");
PrintFormat("One tick better -> same=%s", SamePrice(_Symbol, current, current + tick) ? "true" : "false");
PrintFormat("Rounding noise only -> same=%s", SamePrice(_Symbol, current, current + tick * 0.0001) ? "true" : "false");
if(PositionSelect(_Symbol))
{
double sl = PositionGetDouble(POSITION_SL);
PrintFormat("Position stop=%g, same as itself=%s, one tick better=%s",
sl,
SamePrice(_Symbol, sl, sl) ? "true" : "false",
SamePrice(_Symbol, sl, sl + tick) ? "true" : "false");
}
else
Print("No position on ", _Symbol, ": the position check was skipped");
return INIT_SUCCEEDED;
}
The three example lines should print true, false and true. If they do not, check the tick size of the symbol.
Similar Return Codes
| Code | Name | What it means |
|---|---|---|
| 10025 | TRADE_RETCODE_NO_CHANGES | The request changes nothing |
| 10024 | TRADE_RETCODE_TOO_MANY_REQUESTS | Requests are sent too often |
| 10016 | TRADE_RETCODE_INVALID_STOPS | The stops are too close or on the wrong side |
| 10015 | TRADE_RETCODE_INVALID_PRICE | The price is wrong or not rounded |
| 10006 | TRADE_RETCODE_REJECT | The request was refused |
Checklist: What to Check When You See 10025
- Find the modify call that produces the code.
- Round the wanted stop to the tick size.
- Compare it with the current stop and take profit using a tolerance of half a tick.
- Send only when something changes.
- Move the stop only in the helpful direction and keep the minimum distance.
- Treat 10025 as "nothing to do" in your error handling. Do not retry it.
- Count your requests: one modify per real change, not one per tick.
- Test on a demo account before the EA trades with real money.
Common Mistakes
- Sending a modify on every tick without comparing.
- Comparing
doubleprices with==. - Forgetting to round the wanted stop to the tick size.
- Retrying 10025 as if it were a temporary error.
- Counting 10025 as a failure and raising an alert.
- Comparing the stop with
0.0without handling "no stop" on its own.
FAQ
Related Guides
- MQL5 trade return codes: what each return code means and how to react.
- MQL5 trailing stop EA: move a stop without breaking the minimum distance.
- MQL5 invalid stops error 10016: the matching error for stop loss and take profit.
- MQL5 invalid price error 10015: a price that is stale, on the wrong side or not rounded to the tick size.
- MQL5 invalid volume error 10014: a lot size that does not match the symbol rules.
- MQL5 market closed error 10018: an order sent outside the trading session.
- MQL5 zero divide error: guard a division before you use it.
- Pine Script strategy.exit to MQL5: stop loss and take profit in an EA.
- MQL5 filter positions by magic number: find the position you want to change.
- What to check in a trading bot before going live: a pre-live checklist for stops, lot size, spread and trade results.
- MQL5 request rejected error 10006: the server refused the request without naming a reason.
Fix Compile Errors Without Guessing
If an Expert Advisor does not compile, or you want a second look at its order and risk logic, paste the code into the CodeFlowOS Error Fixer. It suggests a minimal fix, explains each error and shows what changed. A fix uses 1 credit, with up to 3 attempts included, and the compiler check is optional. Outputs are not guaranteed, and code that compiles can still have wrong trading logic, so always review the result. The Code Review is free during the early-bird period and checks an EA for common mistakes such as a fixed lot size or a missing stop loss. CodeFlowOS also converts strategies between Pine Script, MQL5 and cTrader C#: try the converter page.
This article is educational. It does not describe trading performance and is not financial advice. Always compile and test code in MetaEditor and the Strategy Tester before using it on a live account.