Loading…

Mistake Tag Aggregator

Most journal spreadsheets, if they summarise mistake tags at all, sort by count: whichever tag was typed the most times comes first. That answers the wrong question. A tag logged forty times at two dollars a time is an annoying habit; a tag logged twice at four hundred dollars a time is the one actually draining the account. Frequency and cost are different rankings, and only cost tells you where to focus first. This script reads a journal file in a simple documented format - one row per closed trade, with a semicolon-separated tags field - and, for every tag, totals how many trades carried it, the combined result across all of them, and the combined result across the LOSING trades that carried it specifically. The table is then sorted by that losing-only total, costliest tag first, and both printed to the Experts tab and optionally written to a CSV report. The journal format is deliberately minimal - date, ticket, symbol, net P/L, tags - so it can be produced by hand in a spreadsheet, exported from another journalling tool, or built up trade by trade from an EA or script that logs closes automatically. A trade can carry more than one tag ("fomo;oversized") and each tag it carries gets its own share of that trade's result. Notes and limitations - Rows with a non-numeric net_pnl field are skipped and reported by row number in the Experts tab rather than silently treated as a zero-result trade. - Up to 200 distinct tags are tracked; a journal with more than that logs a warning and stops adding new tags past the cap. - The ranking uses only losing trades' contribution to a tag's total. A tag that appears exclusively on winning trades will show a positive "loss only" figure of 0.00 and sort to the bottom, which is intentional - this tool answers "what has this habit cost me," not "what is this tag correlated with." - The tool only reads the journal file; it never touches open orders, chart objects or account state.

Script · MT5 · v1.0 · Free

About Mistake Tag Aggregator

Mistake Tag Aggregator is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Journal file and Report file. MQL source code included.

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

Settings

SettingDefaultWhat it does
Journal filejournal.csvJournal file, read from MQL5\Files
Report filemistake_report.csvOutput table, written to MQL5\Files (blank = skip)

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 → Scripts.
  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 script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria