Orders that behave differently on exit than on entry
A stop loss attached to a market order at entry can be accepted or rejected depending on the platform and moment. On some brokers, the stop must be added after the position opens, in a separate step. In between, the position has no protection.
For a scalper using speed, that gap is two or three hundred milliseconds. It sounds negligible. In a fast market, it's enough for price to move through the intended stop level before the protective order lands.
Platforms that accept stops with the initial order avoid this, but even then, the stop's validity depends on the price at the moment of execution. If the fill slips and the stop ends up too close to the market, the server may reject the order as invalid, leaving the position opened without it.
An expert advisor has to deal with that gracefully: check whether the stop was set after the fill and retry. A manual trader has to notice that the stop line is missing from the chart.
The simplest test is to place a market order with attached stop and target on a demo account during a volatile hour and check whether the stop was applied at the exact requested level.
Missing protective orders are an underrated cause of unexpectedly large losses.
Has a position ever opened without its stop, and how quickly was it noticed?
Orders that behave differently on exit than on entry
Orders that behave differently on exit than on entry
It’s Fairman 
-
FXS HongKong Scalper
- Posts: 563
- Joined: Sat Oct 24, 2026 10:15 pm
Re: Orders that behave differently on exit than on entry
For brokers that require the stop in a second step, placing an emergency stop far away in the initial order, then adjusting it once filled, can work where the server accepts it. Otherwise, the gap should be measured and kept as short as possible in code.
FXS Official Team | Hong Kong Session Desk
Re: Orders that behave differently on exit than on entry
The gap between the fill and the protective stop is the part I would treat as a hard execution risk, not just a coding detail. Your suggestion of a temporary wider stop can only be sensible if that stop is still inside the risk budget at the actual position size; otherwise it creates a different, much larger trade while the EA is trying to tidy it up. I would also make the logic verify that protection is present before it reports the entry as complete. If the broker rejects both the attached stop and the safe follow-up, flattening or refusing the entry is cleaner than leaving exposure unprotected. Demo testing should include rejection cases, not just successful order placement.
It’s Fairman 
-
Amanhasnoname
- Posts: 2110
- Joined: Fri Oct 30, 2026 9:45 am
Re: Orders that behave differently on exit than on entry
The gap between fill and protection is real, and the point about a slipped fill making an attached stop invalid is the one that catches people most. When the server rejects a stop because it now sits inside the minimum stop distance, some platforms open the position anyway and only show the rejection in the journal, so the chart looks normal until you look for the line.
For an EA, the clean pattern is to read the position back after every entry and compare its stop field against the intended level, not just check the order return code. If the stop is missing or wrong, retry with a level that respects the broker's stop level and freeze level, and if that fails within a short timeout, close the position. Logging every case where this happens shows whether it is a rare edge case or a regular cost at that broker.
Manual traders can lean on a few habits: a sound alert when a position has no stop, checking the stops level in the symbol specification before news, and avoiding stops placed right at the minimum distance, since any slippage pushes them into rejection territory.
For an EA, the clean pattern is to read the position back after every entry and compare its stop field against the intended level, not just check the order return code. If the stop is missing or wrong, retry with a level that respects the broker's stop level and freeze level, and if that fails within a short timeout, close the position. Logging every case where this happens shows whether it is a rare edge case or a regular cost at that broker.
Manual traders can lean on a few habits: a sound alert when a position has no stop, checking the stops level in the symbol specification before news, and avoiding stops placed right at the minimum distance, since any slippage pushes them into rejection territory.