The indicator draws the highest high and lowest low of the N bars before each bar, plus the midline. When a bar closes beyond the channel for the first time, an arrow is placed on that bar.
With the trend filter on, an up-arrow is shown only while the D1 EMA is rising over the last k completed daily bars, and a down-arrow only while it is falling.
What you see in history is exactly what you would have seen live.
| Market | Timeframe | Period | Trend filter |
|---|---|---|---|
| XAUUSD swing | H1 | 120 (≈ one week) | D1 EMA 100 |
| XAUUSD position | H4 | 40–80 | D1 EMA 50 |
| BTCUSD | H1 / H4 | 60–160 | D1 EMA 50–100 |
| Indices | H1 | 80–120 | D1 EMA 100 |
| Input | Default | Description |
|---|---|---|
| Channel length | 120 | Bars in the channel |
| Filter by HTF EMA slope | true | Show only trend-direction breakouts |
| Trend timeframe | D1 | Timeframe of the filter |
| Trend EMA period | 100 | EMA length |
| EMA slope look-back | 3 | Completed HTF bars for the slope |
| Alert / Push | false | Notify on a new confirmed arrow |
| Buffer | Content |
|---|---|
| 0 / 1 / 2 | Upper / lower / mid channel |
| 3 | Breakout up (price or EMPTY_VALUE) |
| 4 | Breakout down (price or EMPTY_VALUE) |
int h=iCustom(_Symbol,PERIOD_H1,"GoldDonchianChannel",120,true,PERIOD_D1,100,3,false,false); double up[]; if(CopyBuffer(h,3,1,1,up)==1 && up[0]!=EMPTY_VALUE) Print("confirmed breakout on the last closed bar");
The author's research on XAUUSD M1 data from 2010 to 2026 found that H1/H4 Donchian breakouts in the direction of the D1 EMA trend, with wide ATR stops, were profitable across a broad parameter grid in- and out-of-sample. This indicator shows that signal on your chart; the full trading logic is explained in the author's MQL5 article on building a gold trend-breakout EA.
Author: Shipra Gupta (SGupta30) · complete gold and Bitcoin breakout EAs are in the author's Market profile.
Broker Tick and Rollover Spread Forensic Auditor
Read-only forensic script that audits historical broker Bid/Ask ticks in 15-day RAM-safe chunks: computes session spread percentiles (P50/P95), 23:00-00:15 rollover widening ratios, weekday feed blackout gaps, and exports clean millisecond CSV files.
Relative Volume (RVOL) Indicator in a Subwindow
Relative Volume (RVOL) in a subwindow: the volume of every bar divided by its normal volume, drawn as a color-coded histogram with reference levels and a live text label.
Volatility Squeeze Scanner — Bollinger inside Keltner, with momentum histogram
Shows when volatility is compressed (Bollinger Bands inside the Keltner Channel) and which way it releases. Red dots = squeeze on, green = released, four-colour momentum histogram. Wilder ATR, closed bars, no repaint.
Risk Lot Panel — drag the stop line, read the lot size for your risk percentage
On-chart position-size calculator. Drag the stop line (and optional target line) and the panel shows lots for your risk %, money at risk and reward:risk. Uses OrderCalcProfit, so it is correct for gold, indices, crypto, FX and any account currency.