Loading…

Losing Streak Context Report

A "longest losing streak" number on its own says nothing about why the streak happened. This script walks closed order history in true close-time order, finds every run of consecutive net-losing trades at least InpMinStreakLength long, and for each one reports the symbols involved, a coarse session breakdown by broker server hour, and whether the lot size grew, shrank, or held steady from the first loss to the last. Laid out side by side across several streaks, patterns that are invisible in a single win-rate figure - "my losing streaks are almost always London-session EURUSD trades where size crept up as I chased the recovery" - become visible. Session is assigned from the trade's open time on the broker server's clock, not the trader's local time; this is stated plainly so a "London" bucket is never misread as the trader's own wall clock. History position order is not guaranteed chronological on MT4, so the full trade list is explicitly sorted by close time before the streak walk begins, the same discipline this catalogue's StreakReport.mq4 uses. Size creep is measured only between the first and last trade of each streak, not against the account's overall average lot size - the question this answers is narrower and more useful: did size grow WHILE the streak was in progress, the classic sign of chasing a loss rather than sizing setups independently of recent results. Notes and limitations A net-zero (breakeven) trade is treated as neither a win nor a loss and breaks a streak in progress - it does not extend it either way. Session boundaries (Asian/London/New York/Late) are fixed, coarse hour ranges on the broker server clock and do not adjust for daylight-saving shifts or a specific broker's actual session definition. Lot-size creep is reported only from first to last trade in the streak, not as a full trend line across every trade in it.

Script · MT4 · v1.0 · Free

About Losing Streak Context Report

Losing Streak Context Report is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol filter, Magic filter and From date. MQL source code included.

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

Settings

SettingDefaultWhat it does
Symbol filterSymbol filter ("" = every symbol)
Magic filter-1Magic number filter (-1 = every magic)
From date0Earliest close time (0 = all loaded history)
To date0Latest close time (0 = up to now)
Min streak length3Minimum consecutive losses to be reported as a streak

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: Trading Sessions · Risk & Lot Size · Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria