Loading…

External Change Narrator

An account rarely changes only because the EA watching it decided to change something. Positions get stopped out. Someone closes a trade from their phone between meetings. A second EA on the same account opens its own position, or edits a stop this EA never touched. MT4's own history tab shows what the account looks like now and what it looked like at close time, but nothing narrates the moment a change actually happened, or says plainly what kind of change it was. This EA does that narrating. It never sends a trade itself, so every change it reports is external by definition - there is no "did I cause this" filter to build, only "what changed and how does it read". Each tick it snapshots ticket state - symbol, type, lots, stop-loss, take- profit, open price - and diffs it against the previous snapshot. A new ticket appearing is reported as opened. A stop-loss or take-profit value changing is reported with the before and after value. A pending order's price changing is reported as a modification; a pending order that has filled is reported as triggered. A ticket that vanishes between two snapshots is looked up in trade history and reported with its close price and profit where a history record exists, with a best-effort note when the closing comment looks like a stop-loss or take-profit hit. Every narrated event goes to the Experts log, optionally pops an Alert(), optionally plays a sound, and optionally appends a row to a CSV log file - so a change that happens while nobody is watching the screen is still on record afterward. Notes and limitations - This EA does not trade. It is read-only with respect to the account and safe to run alongside any other EA or manual trading. - The stop-loss/take-profit hit guess on a closed ticket relies on the closing comment MT4 wrote, which is not standardised across every broker - treat it as a hint, not a certainty, and verify from the actual history tab when it matters. - Detection is snapshot-and-diff on a tick-by-tick basis, since MQL4 has no push-style trade event callback. Two changes to the same ticket between two consecutive ticks (rare, but possible on a fast market or a slow chart) would only show the net result, not each intermediate step. - Tracking state lives only in memory for the lifetime of this EA instance; removing it from the chart or restarting the terminal resets the baseline, so the very next tick after that will not narrate anything that changed while it was gone.

Expert advisor · MT5 · v1.0 · Free

About External Change Narrator

External Change Narrator is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 7 settings, such as Use alert popup, Use sound and Sound file. MQL source code included.

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

Settings

SettingDefaultWhat it does
Use alert popuptrueShow a popup Alert() for every classified change
Use soundtruePlay a sound on every classified change
Sound filealert2.wavSound file played on change (must exist in Sounds\)
Write log filetrueAppend every change to a CSV log in MQL5\Files\
Log file nameExternalChangeNarrator_Log.csvLog file name
Magic filter-1Only watch this magic number, -1 = watch every position/order
Max tracked500Maximum tickets tracked at once (array ceiling)

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 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria