Loading…

Requote Pattern Profiler

MQL4 has no API that reveals another trader's or another program's requote history - the only honest sample any EA can build is its own. This EA sends small probe orders on a timer, deliberately requesting a tight slippage tolerance (InpSlippagePips), because a tight tolerance is exactly what invites a requote and makes it a measurable event rather than something the broker quietly absorbs. Every probe attempt is recorded into one of 48 buckets: 24 hours of day, split into a "normal" and a "high volatility" band based on whether the current spread is running above InpHighVolSpreadRatio times its own recent average. A bucket only starts publishing an avoid flag once it clears InpMinSamplesBeforeTrust attempts - an hour with two probes and one requote would otherwise misreport a 50% requote rate that is really just noise from a tiny sample. Once trusted, each bucket publishes RPP_Avoid_<symbol>_<hour>_<band> as a terminal global variable (1.0 = avoid, 0.0 = fine), which a discretionary trader or another EA's execution logic can read before deciding when to place real orders - the actual "scheduling around requotes" this project is named for happens outside this EA, driven by data it measured rather than a guessed rule like "avoid the news". Standalone probing can be turned off (InpStandaloneMode = false) to run purely as a passive log of whatever real trading activity already happens under this chart, though the probe is what generates the bulk of the sample volume in practice. Notes and limitations - Standalone mode genuinely sends real market orders (tiny ones, by default) purely to measure requote behaviour - understand InpProbeLots and InpProbeIntervalMinutes before enabling it on a live account. - A freshly attached chart has no samples for any bucket, so nothing is flagged "avoid" until enough probes accumulate, which can take hours or days at the default interval. - Requote statistics are specific to THIS symbol, THIS broker, and the tight InpSlippagePips setting used to generate them - they are not a general statement about the broker's behaviour under looser tolerances. - Global variables persist across restarts but are shared across every chart of that symbol on this terminal.

Expert advisor · MT5 · v1.0 · Free

About Requote Pattern Profiler

Requote Pattern Profiler is an expert advisor (trading robot) for MetaTrader 5. It has 14 settings, such as Standalone mode, Probe lots and Probe interval minutes. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Standalone modetruetrue = sends its own probe orders; false = passive log only
Probe lots0.01Lot size for each probe order
Probe interval minutes15Minutes between probe attempts
Close probe immediatelytrueClose a filled probe right after it opens
Magic number20260901Magic number for probe orders
Slippage pips1Slippage tolerance requested on the probe (tight, to invite requotes)
Max retries3Attempts per probe action before giving up
Retry wait ms400Pause between attempts, milliseconds
Spread lookback200Ticks used to build the "normal spread" baseline
High vol spread ratio1.5Current spread / average spread above this = "high volatility" bucket
Min samples before trust10Requote-rate samples an hour bucket needs before it is trusted
Avoid threshold pct20.0Requote rate (%) at/above which an hour is flagged "avoid"
Publish global variablestruePublish RPP_Avoid_<symbol>_<hour> flags
Timer interval sec5Panel refresh / scheduling tick, independent of price ticks

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: MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria