Keltner Channel
A Keltner Channel is built from two separate ideas: a smoothed centre line that tracks the trend, and a band width that tracks volatility. The centre line here is an exponential moving average of the typical price (high, low and close averaged), which reacts a little faster to new information than a plain close-based average. The bands sit InpAtrMultiplier average true ranges above and below that line. Using ATR for the band width, rather than a fixed pip distance or a percentage of price, is what makes one set of channel settings behave sensibly on both a quiet major pair and a volatile index or metal without retuning. ATR is read fresh for every bar with the standard MQL4 iATR call, so the channel automatically breathes wider during volatile stretches and tightens during calm ones. Price pressing against or through a band is commonly read as a stretched, overextended move relative to recent volatility, while a band squeeze (upper and lower drawing close together) flags compression that often precedes a range expansion. Notes and limitations - This is a volatility envelope, not a signal generator - it does not draw arrows or alert on band touches. - The EMA and ATR both need InpEmaPeriod / InpAtrPeriod bars of history before the channel starts plotting; the first few bars on a short history are left empty rather than guessed. - Like any moving-average based channel, it lags at sharp trend turns.
Indicator · MT5 · v1.0 · Free
About Keltner Channel
Keltner Channel is an indicator for MetaTrader 5 based on ATR. It has 3 settings, such as Ema period, Atr period and Atr multiplier. MQL source code included.
Files in the download: KeltnerChannel.ex5, KeltnerChannel.mq5, KeltnerChannel.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Ema period | 20 | Period of the typical-price EMA centre line |
| Atr period | 10 | Period of the ATR used for band width |
| Atr multiplier | 2.0 | Bands sit this many ATRs above/below the centre line |
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 → Indicators.
- 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 indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · ATR · Channels & Envelopes · Trend · MT5 Indicator · MQL5 Source Code