Loading…

Re Entry Effectiveness Study

"Getting straight back in" after a stop-out feels like conviction, but it is only worth doing if it actually works. This script scans closed order history for a same-symbol, same-direction trade that opened within a chosen time window after a prior trade closed, treats that as a re-entry, and reports its win rate and cumulative net result separately from the account as a whole. When the prior trade closed at a loss, it additionally reports what fraction of that loss the re-entry recovered - a number that turns "I always get back in after a stop" from a feeling into a figure. There is no reliable way to tell from history alone whether a given re-entry was a deliberate tactic or an unrelated fresh signal that happened to land inside the window. Rather than guess, the window itself (InpReentryWindowMinutes) is left entirely in the trader's hands - set it to match how the account actually re-enters, and the report answers the question honestly for that definition. History position order is not guaranteed chronological on MT4, so the full trade list is explicitly sorted by open time before any pairing logic runs, the same discipline this catalogue's StreakReport.mq4 uses for streak detection. Each losing trade is matched to at most one re-entry - the first same-symbol, same-direction trade to open inside the window - so one stop-out is never counted twice against multiple later trades. Notes and limitations Cannot distinguish a deliberate revenge re-entry from an unrelated signal that happened to fall inside the window - the window is a proxy the trader chooses, not a certainty. Only pairs consecutive same-direction trades on the same symbol; a re-entry on a correlated but different symbol is not detected. A trade still open at the time the script runs is excluded, since only closed history is scanned.

Script · MT4 · v1.0 · Free

About Re Entry Effectiveness Study

Re Entry Effectiveness Study is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Symbol filter, Magic filter and From date. MQL source code included.

Files in the download: ReentryEffectivenessStudy.mq4, ReentryEffectivenessStudy.txt.

Settings

SettingDefaultWhat it does
Symbol filterSymbol filter ("" = every symbol)
Magic filter-1Magic number filter (-1 = every magic)
From date0Earliest open time (0 = all loaded history)
To date0Latest open time (0 = up to now)
Reentry window minutes60Max minutes after a stop-out for the next open to count as a re-entry
Require loss onlytrueOnly treat the prior trade as a trigger if it closed at a net loss

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