Extreme Move Aftermath Study
"Big moves keep moving" and "big moves snap back" are both repeated as trading folk wisdom, usually without either claim ever being counted against real history. This script settles the question empirically, one symbol and timeframe at a time. A bar counts as extreme when its high-low range exceeds a threshold number of standard deviations above the mean range of the trailing baseline window - a genuine sigma test, not a fixed-pip cutoff that means something different on every symbol. For each extreme bar found, the script measures the net price displacement over the following N bars and classifies the outcome as continuation, reversal, or chop against a configurable chop band, then buckets the result by the extreme bar's own direction (bullish or bearish) and by the trading session (Asian, London, Overlap, New York, Late) it occurred in. The baseline window used to judge "extreme" always sits immediately behind the candidate bar and never includes it, so a single huge bar cannot inflate its own threshold. Every bucket in the printed table shows its sample count alongside its percentages, because a session/direction combination with four samples is not the same claim as one with four hundred. Notes and limitations - Session boundaries are fixed server-time hour bands (Asian 0-7, London 7-13, Overlap 13-16, New York 16-21, Late 21-24). They are not adjusted for daylight saving, so a session's true real-world hours can drift by an hour across the year on a broker that observes DST - see DstRegimeSplitAnalyzer.mq4 for a way to check whether that drift matters for a given statistic. - Buckets with single-digit sample counts are printed but not statistically reliable; treat them as leads to re-check on more history, not conclusions. - The sigma threshold uses a simple standard-deviation-of-range baseline, not a formal extreme-value distribution fit - it is a practical filter for "unusually large bar", not a tail-risk model. - This reports what has already happened; it makes no prediction about the next extreme bar's outcome.
Script · MT5 · v1.0 · Free
About Extreme Move Aftermath Study
Extreme Move Aftermath Study is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 8 settings, such as Symbol, Timeframe and Lookback. MQL source code included.
Files in the download: ExtremeMoveAftermath.ex5, ExtremeMoveAftermath.mq5, ExtremeMoveAftermath.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to study, blank = this chart's symbol | |
| Timeframe | PERIOD_H1 | Timeframe whose bars are tested for extremity |
| Lookback | 3000 | Most recent bars to scan for extreme bars |
| Atr period | 100 | Bars used to build the "normal range" baseline |
| Sigma threshold | 3.0 | Range must exceed this many std-devs above the mean range to count as extreme |
| Aftermath bars | 10 | Bars to measure aftermath over, starting the bar after the extreme one |
| Chop band atr | 0.5 | Aftermath move smaller than this many ATRs of net displacement counts as chop |
| Save csv | true | Write the per-bucket table to a CSV file |
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: Trading Sessions · Trailing Stop & Break-even · Alerts · MT5 Script · MQL5 Source Code