Hi, having some trouble here, not sure if anyone will be able to assist me?
Price level was 154.023, 10.8 pips from the attempted SL so not sure why there would be
2024.12.17 23:13:36.741 2024.12.16 16:00:00 failed modify #325 sell 0.2 USDJPY sl: 154.131, tp: 0.000 -> sl: 154.131, tp: 0.000 [Invalid stops]
2024.12.17 23:13:36.741 2024.12.16 16:00:00 ERROR: Failed to modify SL | Ticket: 325 | Error: 4756
ChatGBT told me this about error code but i wanted see if there is a workaround?:
The "Invalid stops" error typically occurs because the stop loss (SL) value you are trying to set does not meet the broker's requirements. This can be due to:
SL too close to the current price – it violates the SYMBOL_TRADE_STOPS_LEVEL.
SL does not align with the symbol's tick size.
Incorrect price normalization.
Best practice is to auto-check SYMBOL_TRADE_STOPS_LEVEL before sending a SL order (or a TP order).
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
- www.mql5.com
Best practice is to auto-check SYMBOL_TRADE_STOPS_LEVEL before sending a SL order (or a TP order).
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5I've tested the SYMBOL_TRADE_STOPS_LEVEL in the ontick and returned 31 points. In the example I showed you, the distance was 10.8, so I'm still not sure why i can't modify the position.
I've tested the SYMBOL_TRADE_STOPS_LEVEL in the ontick and returned 31 points. In the example I showed you, the distance was 10.8, so I'm still not sure why i can't modify the position.
SYMBOL_TRADE_STOPS_LEVEL is an int. It appears that you've used it to define a double without typecasting:
double minSLDistance = SymbolInfoInteger(symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point;

- www.mql5.com
Hi, having some trouble here, not sure if anyone will be able to assist me?
Price level was 154.023, 10.8 pips from the attempted SL so not sure why there would be
2024.12.17 23:13:36.741 2024.12.16 16:00:00 failed modify #325 sell 0.2 USDJPY sl: 154.131, tp: 0.000 -> sl: 154.131, tp: 0.000 [Invalid stops]
2024.12.17 23:13:36.741 2024.12.16 16:00:00 ERROR: Failed to modify SL | Ticket: 325 | Error: 4756
ChatGBT told me this about error code but i wanted see if there is a workaround?:
The "Invalid stops" error typically occurs because the stop loss (SL) value you are trying to set does not meet the broker's requirements. This can be due to:
SL too close to the current price – it violates the SYMBOL_TRADE_STOPS_LEVEL.
SL does not align with the symbol's tick size.
Incorrect price normalization.