Urgent.News

What's breaking now, across thousands of outlets.

Tech

MT5 error 10004: a requote is not a reason to retry forever

Your EA needs a stop condition after a requote. My policy example compiled with 0 errors; it sends no orders and proves no broker-side repair. What the error means A trader asked why a USDJPY buy request returned 10004 when the requested price and the server ask differed by only 0.001. That price difference alone does not establish the cause. The official MT5 server-return table names 10004 as…

In the scenario described, a trader encountered an MT5 error code 10004 when submitting a USDJPY buy request. The error code is officially identified as TRADE_RETCODE_REQUOTE. The trader questioned why only a minor price difference of 0.001 caused the error, without considering other factors.

The article emphasizes that a requote does not automatically justify placing a new order. Other MT5 codes exist for different order statuses, such as placed, completed, or partially completed. The decision to retry or proceed should be based on the actual result and the current account state.

The author proposes a policy to separate requote handling from other order outcomes. The helper function 'MayReconsider' checks if a requote can be reconsidered based on several conditions: the error code must be 10004, the signal must be valid, there must be available attempts, the quote age should be within limits, the spread should be within limits, and the price should be within the acceptable limit.

The function ensures that a requote is only reconsidered under specific conditions, preventing an automatic retry loop from continuing indefinitely once the original conditions have disappeared. The helper function only provides a local policy decision and does not handle order submission. The caller is responsible for checking the current order and position state before making any new order submissions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

12 Domain Hack Examples That Work

Domain hack examples show how a short extension can finish a word, as in bit.ly or youtu.be. Twelve well-known ones are listed below. They work because they are short, easy to say and clear.

More from Friday 23 October →