Screenshot On Trade
Reviewing trades later is far more useful with a picture of the chart at the moment of each decision than with numbers alone. This EA watches the order pool the same way the rest of this catalogue's trade-event watchers do - polling and diffing against the last known state of every tracked ticket, since MQL4 has no trade-transaction callback - and calls ChartScreenShot() when a trade opens, closes, or (optionally) has its stop loss or take profit edited. The filename is built from the symbol, the event type, the ticket number, a timestamp, and a run-local counter. The counter matters: TimeCurrent() only has one-second resolution, and closing a basket of several positions at once can produce several close events inside that same second. A filename built from the timestamp alone would have the second screenshot silently overwrite the first, and the review record would be missing exactly the trade someone wanted to look back at. Notes and limitations - Detection is poll-based, not instant: a screenshot is taken within InpCheckIntervalSec of the event, not at the exact tick it happened. - If a trade opens and closes again within the same poll interval, only the close screenshot is taken - the open state was never observed. - Files are written into the terminal's sandboxed Files folder, which is where MQL4 file functions are restricted to; they are not saved anywhere else on disk. - Reattaching the EA seeds tracking from whatever is currently open, so a restart does not capture an "open" screenshot for every pre-existing trade. - This EA only observes and captures. It never opens, closes or modifies a trade itself.
Expert advisor · MT5 · v1.0 · Free
About Screenshot On Trade
Screenshot On Trade is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 9 settings, such as Capture on open, Capture on close and Capture on modify. MQL source code included.
Files in the download: TradeScreenshot.ex5, TradeScreenshot.mq5, TradeScreenshot.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Capture on open | true | Capture when a trade opens |
| Capture on close | true | Capture when a trade closes |
| Capture on modify | false | Capture when SL/TP changes on an open trade |
| Symbol only | false | Only track trades on this chart's symbol |
| Magic filter | 0 | Only track this magic number (0 = all magic numbers) |
| Check interval sec | 3 | Seconds between polls of the position book |
| Sub folder | TradeScreenshots | Folder under MQL5\Files to save into |
| Image width | 1024 | Screenshot width, pixels |
| Image height | 600 | Screenshot height, pixels |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Expert Advisor · MQL5 Source Code