Loading…

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

SettingDefaultWhat it does
Magic filter0Tag trades with this magic number (0 = manual/unmagicked trades)
Setup tagsBreakout,Pullback,Reversal,News,OtherComma-separated setup tag choices
Mistake tagsNone,FOMO,MovedStop,Oversized,Revenge,OtComma-separated mistake tag choices
Report fileTradeReasonCodeTagger.csvFile name in MQL4\Files\

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: Breakout · News Trading · Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria