Sample diagnostic: MT5 invalid-stops rejection
This fictional incident shows the structure of a bounded report. The numbers are deliberately synthetic; no client, account or performance result is represented.
Finding
The requested stop was 30 points inside the frozen minimum distance.
Smallest next step
Validate and normalize protective prices before OrderSend.
Acceptance basis
Four deterministic cases, including the exact broker boundary.
1. Frozen evidence
- Platform
- MetaTrader 5 / synthetic broker profile
- Incident
- BUY request rejected with trade retcode 10016 (invalid stops)
- Observed quote
- Bid 1.08420 / Ask 1.08432
- Requested stop loss
- 1.08400
- Frozen symbol rules
- 5 digits, point 0.00001, minimum stop distance 50 points
- Measured distance
- 20 points from Bid to requested stop loss
Reproduction
For a BUY position, the stop loss is checked from the current Bid. In this frozen example, 1.08420 − 1.08400 equals 0.00020, or 20 points. The symbol requires 50 points, so the request violates the recorded broker rule before it reaches strategy logic.
2. Acceptance matrix
| Case | Input | Expected behaviour | Class |
|---|---|---|---|
| Below the boundary | SL 49 points below Bid | Reject locally; do not send the trade request | Negative |
| Exact boundary | SL 50 points below Bid | Normalize to tick size, then allow the request | Boundary |
| Valid distance | SL 55 points below Bid | Allow the request and log the frozen calculation | Positive |
| Missing symbol data | Stops level or tick size unavailable | Fail safely and request fresh symbol data | Negative |
3. Bounded recommendation
- Read point, tick size and stop level from the active symbol at runtime.
- Validate the protective price on the correct Bid/Ask side before submission.
- Normalize to tick size and log both raw and normalized values.
- Run the same frozen four-case matrix after the change.
Software-engineering example only. Prices, quotes and broker constraints on this page are invented for demonstration and are not trading advice.