Strategy testing and trading software · Germanycontact@stratcorealpha.com · DE
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

Swipe the table sideways to read every case.

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.

Trading risk disclosure

Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one's financial security or lifestyle. Only risk capital should be used for trading, and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical performance disclosure

Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. There are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical results are generally prepared with the benefit of hindsight, do not involve financial risk, and cannot completely account for the impact of financial risk in actual trading. Market conditions, the ability to withstand losses, and adherence to a trading program can all materially affect actual results.

NinjaTrader trademark disclosure

NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described herein, or any interest, ownership or otherwise, in any such product or service, or endorses, recommends or approves any such product or service.

Testimonials, when shown, may not represent the experience of other clients and are not a guarantee of future performance or success. Virtual-currency trading carries additional risks. See the CFTC customer advisories. Read the full financial risk disclaimer.