Loading…

Requote Retry Manager

Most published EAs treat OrderSend failure as binary: it worked, or the whole entry attempt is abandoned. In live trading that throws away trades on transient noise - a requote, a momentarily busy trade context, a slow tick during news - that would have gone through on a second attempt taken a few hundred milliseconds later with a fresh price. This tool isolates that retry logic into one self-contained button press so its behaviour can be inspected directly rather than trusted blindly. It first classifies the broker error: retryable codes such as requote, off quotes, price changed, server busy and trade context busy get another attempt; permanent codes such as invalid stops or insufficient margin stop the sequence immediately, because retrying those only wastes time and log noise. A busy trade context is treated as a queue, not a failure, and is waited out before the attempt counter is even touched. Every retry refreshes rates and rebuilds the order at the current price rather than resending a stale one, and the wait between attempts doubles each time (the backoff multiplier and cap are both inputs), so a genuinely struggling server is not hammered with instant resends. Trading is disabled by default. The on-chart panel reports exactly what happened on the last sequence - attempt count, retry count and the final outcome - so the retry behaviour is visible, not just assumed. Notes and limitations - This is a retry-logic demonstration, not a trading strategy. It opens at most one order per button press, only on request. - The backoff schedule is deliberately simple (multiply and cap) rather than jittered; that keeps the demonstration readable, but a production system trading at scale would usually add random jitter to avoid many clients retrying in lockstep after a shared outage. - Permanent errors stop the sequence immediately by design - retrying an invalid-stops or no-money error only produces log noise, never a fill.

Expert advisor · MT5 · v1.0 · Free

About Requote Retry Manager

Requote Retry Manager is an expert advisor (trading robot) for MetaTrader 5. It increases the lot size after a losing trade (martingale). It has 10 settings, such as Enable trading, Max retries and Base wait ms. MQL source code included.

Files in the download: RequoteRetryManager.ex5, RequoteRetryManager.mq5, RequoteRetryManager.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Enable tradingfalseOff by default - arm before pressing the demo button
Max retries5Maximum send attempts before giving up
Base wait ms300Base wait between attempts, milliseconds
Backoff multiplier2Wait multiplies by this after each retryable failure
Max wait ms5000Cap on the backoff wait, milliseconds
Lots0.01Lot size for the demo order
Slippage pips3Slippage tolerance, in pips
Stop loss pips20Stop loss distance, in pips (0 = none)
Take profit pips0Take profit distance, in pips (0 = none)
Magic20261301Magic number this EA tags its own orders with

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: News Trading · Binary Options · Martingale · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria