Trade Reason Code Tagger
A trading journal usually dies the same way: the first week is detailed prose, the second week is a few words, and by the third week nothing gets written at all. This tool removes the writing. The instant a trade closes it puts up two rows of buttons - a setup tag (Breakout, Pullback, Reversal, News, Other by default) and a mistake tag (None, FOMO, Moved Stop, Oversized, Revenge, Other) - and will not let a new offer appear until the current one is tagged or explicitly skipped. Every save appends one row to a CSV in MQL4\Files\ with the ticket, symbol, direction, lot size, open and close time, realised profit, and both tags - the fields needed to actually pivot and filter the data in a spreadsheet later, not a free-text note nobody re-reads. Because the file is expected to hold a modest number of rows for a manual trading journal, saving reloads the existing rows and rewrites the file whole rather than appending in place; that trades a little I/O for never leaving a half-written row if the terminal closes at an unlucky moment. Notes and limitations - Only trades closed after the EA was attached are offered for tagging; older history is left alone rather than queued up all at once. - One trade is offered at a time. If several close close together the rest wait their turn rather than overlapping panels. - Up to 8 tags per list are supported; extra comma-separated entries beyond that are ignored. - The CSV is fully rewritten on every save. Fine for a personal trading journal's typical row counts; not built for tagging thousands of trades a session. - Never sends, modifies or closes an order - it only reads history and writes the tag file. - (MQL5 only) Assumes no partial closes when reconstructing a position's record - see MQL4 VERSUS MQL5 DIFFERENCES above.
Expert advisor · MT4 · v1.0 · Free
About Trade Reason Code Tagger
Trade Reason Code Tagger is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Magic filter, Setup tags and Mistake tags. MQL source code included.
Files in the download: TradeReasonCodeTagger.ex4, TradeReasonCodeTagger.mq4, TradeReasonCodeTagger.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Magic filter | 0 | Tag trades with this magic number (0 = manual/unmagicked trades) |
| Setup tags | Breakout,Pullback,Reversal,News,Other | Comma-separated setup tag choices |
| Mistake tags | None,FOMO,MovedStop,Oversized,Revenge,Ot | Comma-separated mistake tag choices |
| Report file | TradeReasonCodeTagger.csv | File name in MQL4\Files\ |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Breakout · News Trading · Alerts · MT4 Expert Advisor · MQL4 Source Code