Markets alternate between quiet and active phases. A long quiet phase is often followed by a sharp move, but the direction of that move is not known in advance. The squeeze concept finds the quiet phase objectively by comparing two volatility envelopes:
When the Bollinger Bands are completely inside the Keltner Channel, volatility has contracted to an unusually low level: the market is "squeezed". When the bands move back outside the channel, the squeeze is released and a directional move often follows.
To estimate the likely direction, the indicator also plots a momentum histogram: the linear regression of the distance between the close and the mid-line (the average of the middle of the highest-high/lowest-low range and the simple moving average of the close). Positive values mean that price is above its mid-line, negative values that it is below.

Fig. 1. Squeeze Momentum below an M15 chart: a squeeze (white dots on the zero line) during the consolidation and the momentum histogram after its release; black & white image per Code Base image guidelines (colors are configurable).
| Input | Default | Purpose |
|---|---|---|
| InpBBLength | 20 | Period of the Bollinger Bands (2 or more). |
| InpBBMult | 2.0 | Standard deviation multiplier of the Bollinger Bands; must be greater than zero. |
| InpKCLength | 20 | Period of the Keltner Channel and of the momentum calculation (2 or more). |
| InpKCMult | 1.5 | Range multiplier of the Keltner Channel; must be greater than zero. Smaller values make a squeeze rarer and more significant. |
| InpUseTrueRange | true | Channel width: true uses the True Range of the bars, false uses the simple High−Low range. |
| InpAlert | false | Shows an alert when a squeeze is released on a closed bar. |
| InpShowInfoLabel | true | Shows the label with the squeeze state and the momentum value. |
| InpLabelColor | clrSilver | Color of the info label. |
The colors of the histogram and of the dots can be changed on the "Colors" tab of the indicator properties.
Truncation Audit: Detecting Look-Ahead and Repainting in MQL5 Indicators.
Part 3 of the indicator regression-testing series. Compares the value an indicator had when each bar closed with the value recomputed on the later history, flags every bar that changed (look-ahead or repainting), and measures how many future bars each value needed before it settled.
Volatility Regime Percentile
Ranks the current ATR against its own recent history and colours each bar as a LOW, NORMAL or HIGH volatility regime, with a panel showing ATR in price and points, ATR vs its median and how long the regime has held.
Donchian Channel with Breakout Alerts
Donchian Channel (highest high and lowest low of the last N bars) with a middle line, breakout arrows on the chart and alerts by pop-up window, push notification or e-mail when price breaks out of the channel.
Volatility Regime Indicator (Low, Normal, High) in a Subwindow
Classifies the current market volatility as Low, Normal or High by ranking the ATR against its own recent history. The percent rank is shown as a color-coded histogram in a subwindow, with optional alerts when the regime changes.