Loading…

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

SettingDefaultWhat it does
Capture on opentrueCapture when a trade opens
Capture on closetrueCapture when a trade closes
Capture on modifyfalseCapture when SL/TP changes on an open trade
Symbol onlyfalseOnly track trades on this chart's symbol
Magic filter0Only track this magic number (0 = all magic numbers)
Check interval sec3Seconds between polls of the position book
Sub folderTradeScreenshotsFolder under MQL5\Files to save into
Image width1024Screenshot width, pixels
Image height600Screenshot height, pixels

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