Loading…

Requote And Rejection Log Parser

A single requote is an anecdote. A hundred requotes concentrated between 13:00 and 14:00 server time on one symbol is a pattern, and a pattern is what actually gets a broker to change something. The gap between the two is usually a spreadsheet nobody has time to build by hand from a scrolling log window. This script reads a plain text log copied into MQL4\Files and recognises two different shapes of rejection line, because MetaTrader itself produces both depending on where the failure is logged. The terminal's own Trade log prints a bracketed reason with no numeric code at all - "failed [Requote]", "failed [Off quotes]" - and those phrases are mapped here to the same error constants the rest of this catalogue's own scripts use for the identical failure. Every trading program in this catalogue, in turn, prints its own rejections as "error 138 (requote)" through its own error handling, and that shape is recognised too. A line matching neither pattern is simply not a rejection and is stepped over without comment, which is most of any real log. Symbol identification does not guess at a token shape from the surrounding text - broker symbol names vary too much, with suffixes, prefixes and embedded numbers, for a fixed pattern to hold reliably. Instead each line is checked against every symbol this terminal already knows, longest name first, so "EURUSD" is never mistaken for a match inside a broker's own "EURUSDpro". The hour comes from the first clock time found on the line by its colon, not a fixed column position, because the two log shapes carry the timestamp with different millisecond suffixes. That single small decision is what lets one parser handle both formats without two separate code paths. Notes and limitations - Only text actually present in the log is used. A terminal set to log at a lower verbosity than the default will simply not have some of these lines to find. - The bracketed-phrase list covers the common trade failures - requote, off quotes, not enough money, trade timeout, invalid price, invalid stops, trade context busy, no connection, market closed, trade disabled, broker busy. A phrase outside that list is not recognised even if it clearly means a rejection. - Symbol matching depends on the symbol already being known to this terminal. A log copied from a different broker's terminal, referencing symbols this one has never seen, will file those lines under UNKNOWN. - Up to 1000 individual events are recorded in full; a log with more than that still contributes to the totals but stops appearing in the per-row breakdown past the cap, and the summary says so.

Script · MT4 · v1.0 · Free

About Requote And Rejection Log Parser

Requote And Rejection Log Parser is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Log file name and Save csv. MQL source code included.

Files in the download: RequoteRejectionLogParser.ex4, RequoteRejectionLogParser.mq4, RequoteRejectionLogParser.txt.

Settings

SettingDefaultWhat it does
Log file nameterminal.logLog file to parse, from MQL4\Files
Save csvtrueWrite one CSV row per matched event

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria