Loading…

Trade Burst Clustering Report

"Revenge trading" and over-clicking after a loss are common accusations levelled at a trader's own history, but rarely checked with numbers. This script does the check: it walks every closed market trade in the account, sorted by OPEN time (not close time - overlapping trades would otherwise misclassify), and groups any run of trades whose opens fall within a configurable gap of each other into a burst. Isolated trades that never cluster are kept as a separate "spaced-out" group. Each group gets its own win rate, total lots, net profit, profit factor and average profit per trade, printed side by side so the comparison is direct rather than left to the trader's memory of how the session felt. Grouping by open-time gap rather than close-time gap matters: two trades opened one minute apart but held for different lengths would look "spaced out" by close time even though they were opened in the same burst of activity - close-time grouping would hide exactly the pattern this script is built to surface. Notes and limitations This is a descriptive comparison, not a causal test - a burst that performs worse does not prove bursts cause losses; the trader may burst-trade precisely during volatile, harder conditions. A very short account history with few trades produces a burst-vs- spaced split too small to draw a real conclusion from. Multiple EAs trading the same account can blend into the same burst; use InpMagicFilter to isolate one.

Script · MT4 · v1.0 · Free

About Trade Burst Clustering Report

Trade Burst Clustering Report 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 Burst gap seconds, Min burst size and Magic filter. MQL source code included.

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

Settings

SettingDefaultWhat it does
Burst gap seconds300Max gap between opens to stay in the same burst (seconds)
Min burst size2Minimum trades to count as a "burst" rather than a spaced trade
Magic filter-1Magic filter (-1 = all)
Symbol filterSymbol filter ("" = all)
Export csvfalseAlso write the burst table to a CSV file
DelimiterDelimiterCommaCSV column separator

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