Back to the diagnostic
Synthetic example · not customer work

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

CaseInputExpected behaviourClass
Below the boundarySL 49 points below BidReject locally; do not send the trade requestNegative
Exact boundarySL 50 points below BidNormalize to tick size, then allow the requestBoundary
Valid distanceSL 55 points below BidAllow the request and log the frozen calculationPositive
Missing symbol dataStops level or tick size unavailableFail safely and request fresh symbol dataNegative

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.