Trade Journal with Excursion Stats and Screenshots
- Utilities
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.2
- Activations: 5
Trade Journal with Excursion Stats and Screenshots is a utility Expert Advisor for MetaTrader 5 that keeps a journal of your closed trades. For each closed position it writes one row to a CSV file: open and close, profit, commission and swap, MAE and MFE (Maximum Adverse Excursion: how far the price went against the trade; Maximum Favorable Excursion: how far it went in its favor), the R multiple and the holding time. It also builds an HTML summary and, when a chart of the symbol is open, saves a chart screenshot at entry and at exit. It records your manual trades and the trades of your other EAs; you can filter by symbol and magic number.
It is a record of past trades, not a trading strategy. It gives no buy or sell signals, does not judge whether a trade or a method is good, and does not promise or improve any result. It never opens, closes or changes a position or an order on a real or demo account. (Only in the Strategy Tester it opens small demonstration trades; see Notes and Limits.)
Privacy: the EA does not write your account number, server name or balance to the files or the screenshots, and the panel does not show them. The folder uses a journal name you choose (default "MyJournal"). To stop two accounts from mixing in one journal, owner.txt keeps only a short hash, not the account number or the server name. Screenshots show the chart only; anything that other indicators, EAs or chart comments draw on the same chart is captured as it is.
Features
- CSV journal (journal.csv), one row per closed position, 32 columns: position ID, symbol, side, lots, open and close time and price, initial SL and TP and their source, profit, commission, swap, net, pips, holding time, MAE and MFE (price distance, pips, money), the data source of MAE/MFE, risk money, R multiple, entry and exit image, magic number, comment and a note (for example close: SL, close: TP, partial closes).
- HTML summary (journal.html): number of trades, net total, average R, average MAE and MFE (in pips for FX and in R) for all trades, wins and losses; distribution tables of MAE and MFE in R and in pips; the newest trades with links to their images. All figures are calculated only from the trades in your journal.
- Chart screenshots (PNG) at entry and at exit, saved in the images folder of the journal and linked from the HTML.
- MAE and MFE are updated on every tick while a trade is open. Periods when the EA was not running are filled from tick history when available, otherwise from M1 bars.
- On start, closed trades of the last N days that are not yet in the journal are added (default 7 days).
- No duplicates: written trades are remembered, so a restart, a timeframe change or a second chart with the same journal name does not write a trade twice.
- Filters: symbols, magic numbers, manual trades on or off.
- Panel: journal name, recorded trades, trades being watched, the last recorded trade and status messages. English or Japanese (automatic from the terminal language); the HTML uses the same language.
- CSV separator: comma or semicolon (for Excel in regions that use a decimal comma).
Main Inputs
- Trades to record: symbols (empty = all), magic numbers (empty = all EAs), include manual trades (default ON), on start add unrecorded closed trades of the last N days (default 7, 0 = none).
- Files: journal name = folder name (default "MyJournal"; not your account number), CSV separator (new file only), HTML summary ON/OFF, number of newest trades listed in the HTML (default 1000).
- MAE / MFE: price used (closing price side = Bid for buys and Ask for sells, default; or the chart price Bid for both), fill missed periods from tick history (default ON) for periods up to N hours (default 24; longer periods use M1 bars).
- Screenshots: ON/OFF (default ON), image width and height (default 1280 x 720).
- Panel (show, language, corner, offsets, font size) and Strategy Tester demo trades ON/OFF.
- 21 inputs in 6 groups.
How It Works
- Files are written to MQL5\Files\TradeJournal\<journal name>\ : journal.csv, journal.html, the images folder and small helper files (written_ids.txt, open_state.txt, owner.txt). Open it with File > Open Data Folder.
- MAE and MFE are distances from the open price, recorded as positive values in price, pips and money. By default buys are measured with Bid and sells with Ask (the price at which the trade would close). An input switches to the chart price (Bid) for both.
- While the EA runs, MAE and MFE are counted from the tick history of each symbol, so no tick is skipped.
- Periods when the EA was not attached or was stopped are filled from tick history (up to the hours you set) or from the highs and lows of M1 bars. The column mae_mfe_source shows tick, bar or tick+bar, and "(incomplete)" when data was missing.
- Bar of entry and bar of exit: only the part after the entry and before the exit is used. With tick history this part is measured tick by tick. Without tick history, only the close of the entry bar and the open of the exit bar are used; the high and low of those two bars are not included, because they may lie before the entry or after the exit. Moves inside those two bars can therefore be missed. A period shorter than one minute uses only the open and close prices.
- When sells are measured with Ask and M1 bars are used, the spread of that bar is added to the bar values, so these values are estimates.
- To read the bars and ticks of a symbol, the EA may add that symbol to Market Watch (SymbolSelect).
- Pips are shown only for symbols quoted with 3 or 5 decimals (normally FX pairs); 10 points = 1 pip. For other symbols (gold, indices, crypto and so on) the pips columns are empty; use the price and money columns. The pips tables and averages in the HTML use FX trades only. If your broker quotes a non-FX symbol with 3 or 5 decimals, it gets a pips value too.
- R multiple = net result (profit + commission + swap) / initial risk. Initial risk = distance from the open price to the first stop loss x lots, converted to account currency at the rate when the trade is recorded. The first stop loss is taken from the order that opened the position. Trades without a stop loss have an empty R.
- Netting accounts: added volume uses the average open price. A position that was reversed gets n/a for MAE/MFE and no R.
- Screenshots are taken only when a chart of the trade's symbol is already open in the terminal. If none is open, the journal shows "no chart"; the EA never opens a new chart. If saving fails, the journal shows "failed", the panel shows a message and recording continues. Other values: "off" (screenshots OFF) and "EA off" (the EA was not running at that moment).
Notes and Limits
- Not a signal and not an evaluation. The figures describe your past trades. How you read them and how you trade remain your decision. Past results do not show future results.
- MAE/MFE filled from M1 bars are approximate, and moves inside the entry and exit bars can be missed when no tick history is available.
- Use one journal name per account. If another account uses the same journal name, the EA stops recording and asks for another name. If you log in to another account while it runs, it stops recording until you attach it again with another name.
- If the same journal name runs on two charts, only one chart writes. The other waits and takes over if the first one stops (within about 15 seconds).
- While journal.csv is open in Excel, it cannot be written. The EA retries every 5 seconds and shows this on the panel; trades are kept and written when the file is free. To look at the data while recording, open a copy.
- The EA records only while MetaTrader 5 is running. Trades closed while it was off are added at the next start when they are within the last N days.
- Strategy Tester: with "Tester only: small demo trades to show the journal" ON (default), the EA opens small demonstration trades so that the journal can be seen: minimum lot, magic 73250, at most one per day, buy and sell in turn, each with a stop loss and take profit and closed after about 3 hours. They exist only to show the recording; they are not a trading method, not a signal and not aimed at any market time (none are opened around the day change, when spreads are wide). The tester report shows only these trades and is not a trading result; it can be a loss. No screenshots are taken in the tester. These trades never run on a real or demo account.
Compatibility and Support
- MetaTrader 5 (hedging and netting accounts). The MetaTrader 4 edition is sold separately.
- Attach it to one chart. For screenshots, keep a chart of each symbol you trade open.
- No DLLs, no internet, no outside server. All files stay on your computer.
- Try it on a demo account first.
- Support through MQL5 messages, reply within 3 business days: installation, settings, files and bug reports. We cannot review or rate your trades, suggest stop or target levels, give market views or trade decisions.
- No result of your trading is promised or implied.
