DEV Community

Arnold Holm
Arnold Holm

Posted on Edited on Originally published at stratcorealpha.com

Error 136: another retry is not a quote check

My native MT4 run passed three synthetic policy cases with zero order calls. If your EA keeps hitting off quotes, you still need a quote check first.

This is a small policy check after error 136. A synthetic check with no orders cannot prove a broker cause and cannot show that retries fail.

The forum thread

A trader asked why 10 to 15 repeated OrderSend attempts still return error 136. See the MQL5 forum.

James said 10 to 15 attempts still returned the same error. His helper read the chart price for the passed pair. A reply said that mix uses the wrong price when symbols differ. James fixed that line, but he trades only the chart symbol now. So that fix does not explain his failures. Without per attempt symbol, prices, quote time and error, the cause stays open.

Many EAs assume this. Repeating the request will eventually solve off quotes. My rule says the opposite. A new attempt needs a usable quote and a still-valid signal.

What my policy check did

I ran a native check in MT4 4.0.0.1491. It compiled with zero errors and zero warnings. It ran in the Strategy Tester on offline EURUSD H4 supplied history with fixed spread 20 points.

Zero quote inputs returned NO_RETRY. Expired signal inputs returned NO_RETRY. Fresh inputs returned ELIGIBLE_ONCE, then NO_RETRY with alreadyConsidered at 1.

Three chosen cases, not full coverage. The five second and one consideration limits are illustrative, not universal.

if Bid <= 0 or Ask < Bid: return NO_RETRY
if quote_age_sec > 5 or quote_time > now: return NO_RETRY
if now > signal_expiry: return NO_RETRY
if alreadyConsidered >= 1: return NO_RETRY
return ELIGIBLE_ONCE
Enter fullscreen mode Exit fullscreen mode

The function does no waiting, no persistence, no network access, no orders and no duplicate checks. Your caller must keep its own count. Eligibility only allows one more review of all execution checks, never a trade by itself.

Why I check first

I check the quote and the still-valid signal before considering another attempt. If the quote is missing or unusable, I stop. If the symbol is wrong, I stop. If the signal or count is spent, I stop.

Check your next result

On your next off quotes result, write request symbol, Bid and Ask, quote time, signal expiry, captured error 136 and attempt count in one line. Missing or disordered prices mean no further review of that attempt.

Confirm the price read uses the order symbol. Compare now with expiry and read your kept count. If any check fails, keep the record and wait for a fresh idea.

What this check does not show

Three chosen cases, zero order calls. Error 136 was not reproduced or fixed. No broker, execution or profit claim.

Original website article with tester proof.

Top comments (0)