Most trade reports end at the exit. This script looks at what happened next.
For every closed position in the selected period it reads the following M1 bars and measures, from the exit price: the best move in the trade's direction (how much was left on the table), the worst move against it (how much the exit saved), and whether the take-profit level was reached after the exit, and how many minutes later.
Moves are shown in R (multiples of the initial stop distance) when the position had a stop loss, otherwise in points.

| Input | Default | Meaning |
|---|---|---|
| History to analyse (days) | 90 | Exit time window |
| Symbol filter | "" | Empty = all symbols |
| Magic number filter | -1 | -1 = all, 0 = manual trades |
| Market hours to watch after each exit | 24 | Counted in M1 bars, so weekends do not use up the window |
| Positions listed in the Experts log | 25 | Rows printed in the Experts tab |
| Write a CSV file | true | Writes AfterExit_<login>.csv |
| Draw the summary panel | true | false removes the panel from the chart |
Run it on any chart: drag the script from the Navigator, set the inputs and press OK. Run it again with Draw the summary panel = false to remove the panel.
Algo: EMA Trend Cross on Closed Bars — XAUUSD M30
Free educational EA — a single-position trend-following EMA crossover system for XAUUSD M30, released as open source for beginners to study trade ownership guards, preflight order validation, risk-based lot sizing, and server-time session filtering. This code demonstrates how a strategy - identifies and manages only its own positions and orders through MagicNumber and comment tags, - wraps CTrade with an OrderCheck preflight that blocks invalid or margin-breaking requests, - sizes each trade from a fixed stop-loss and risk percentage, - and restricts entries to a configurable broker session window with a daily close-all — all evaluated on completed bars only, so signals never repaint.
Fair Value Gaps
Non-repainting fair value gaps on closed bars, with zone states (active, touched, mitigated) and iCustom buffers for EAs.
Trend Regime Indicator
Trending up, trending down or ranging: a verdict for every bar, and how long it has held. Each stretch of one regime is boxed on the price chart, ADX columns below show how strong it is, and a one-line panel gives the regime, its age and the ADX. Values for Expert Advisors and an alert on closed bars.
Mouse Scroll Zoom in Zoom Out
Mouse Scroll Zoom in Zoom Out