Error 130 gets blamed on the stop level, yet at least three separate things trigger it. The obvious one is placing a stop closer than the broker's minimum distance. The second is placing it on the wrong side of the market, which happens when a script uses a stale price. The third is wrong rounding, such as a stop price with too many decimals for the symbol.
The stale price case is common on fast tape. The EA reads the ask, calculates a stop, and by the time the request arrives, the market has moved enough that the stop now sits inside the minimum distance.
Another trap is mixing up bid and ask. A buy stop-loss is compared against the bid, while a sell stop-loss is compared against the ask. Using the wrong side shaves off the spread from the distance and can push a borderline stop into invalid territory.
Defensive code refreshes rates immediately before sending, adds a small buffer to the minimum distance, and normalizes the price.
Which of the three causes shows up most in the logs?
Three different causes hide behind "invalid stops"
-
Amanhasnoname
- Posts: 1506
- Joined: Fri Oct 30, 2026 9:45 am