# Squeeze Momentum Indicator for MT4

> Shows when Bollinger Bands sit inside the Keltner Channel (a volatility squeeze) and plots a linear-regression momentum histogram coloured by direction.

## At a glance

- What it is: A free Indicator for MetaTrader 4, written in MQL4.
- What it does: Shows when Bollinger Bands sit inside the Keltner Channel (a volatility squeeze) and plots a linear-regression momentum histogram coloured by direction.
- Shared by: Alex
- Licence: MIT
- Version: 1.0 (1 Dec 2026)
- Settings: 18 inputs
- Lab check: Compiled with MetaEditor build 2425 for MT4 on 1 Dec 2026: 0 errors, 0 warnings.
- Price: Free to download
- Page: https://hub.fxnook.com/squeeze-momentum-indicator-for-mt4
- Download (compiled): https://hub.fxnook.com/download/e65b8ad1-00c1-43b3-a3b7-c942c40c8bda/compiled
- Download (source): https://hub.fxnook.com/download/e65b8ad1-00c1-43b3-a3b7-c942c40c8bda/source

## About

Markets alternate between quiet, tight periods and strong moves. This indicator shows when volatility is compressed (a squeeze) and which way momentum is pointing, so you can prepare for the move that often follows a squeeze instead of chasing it.

## How it works

- **Bollinger Bands:** SMA of close over `BB length` plus and minus `BB deviations` x standard deviation.
- **Keltner Channel:** SMA of close over `KC length` plus and minus `KC width` x the average range (true range, or high minus low).
- **Squeeze on** (first dot colour) when both Bollinger Bands are inside the Keltner Channel. **Squeeze off** (second colour) when both are outside. Grey when neither.
- **Momentum:** for each bar, `x = close - ((highest high + lowest low) / 2 + SMA(close)) / 2` over `KC length` bars. The histogram is the end value of a least-squares regression line through the last `Momentum length` values of x.
- Histogram colours: above zero and rising, above zero and falling, below zero and falling, below zero and rising.

## Inputs

| Input | Default | What it does |
|---|---|---|
| BB length / deviations | 20 / 2.0 | Bollinger Bands settings |
| KC length / width | 20 / 1.5 | Keltner Channel settings |
| True range | true | Keltner range uses true range (false = high - low) |
| Momentum length | 20 | Regression length of the momentum |
| Four histogram colours | Lime / Green / Red / Maroon | Rising and falling above and below zero |
| Squeeze on / off / neither | OrangeRed / LimeGreen / DimGray | Dot colours |
| Alert when squeeze ends | false | One alert when a closed bar ends a squeeze |

## How to use it

1. In MetaTrader open **File > Open Data Folder**.
2. MT4: copy `FXN_SqueezeMomentum.mq4` into `MQL4/Indicators`. MT5: copy `FXN_SqueezeMomentum.mq5` into `MQL5/Indicators`.
3. Right-click **Indicators** in the Navigator and choose **Refresh** (or restart the terminal). The file compiles on first use; you can also open it in MetaEditor and press Compile.
4. Drag the indicator onto a chart and set the inputs.

The defaults (20 / 2.0 / 20 / 1.5) are the classic settings and work on most symbols from M15 to D1. A common reading: wait for a run of squeeze-on dots, then watch the first bar after the squeeze ends; the side of zero the histogram is on and whether it is rising gives the likely direction. Pair it with a trend filter or support and resistance.

## Good to know

- The values on the forming bar change with price, like any oscillator. Dots and colours on closed bars are fixed. The alert only looks at closed bars.
- A squeeze can end with a false start; momentum can flip soon after.
- The histogram is in price units, so its size differs between symbols.
- It is a visual tool and does not trade.

Trading carries risk. Test on a demo account first; past results do not predict future results.

## Settings (inputs)

| Input | Type | Default | Note |
|---|---|---|---|
| InpSep1 | string | === Squeeze === | ---- Squeeze ---- |
| InpBBLength | int | 20 | Bollinger Bands length |
| InpBBMult | double | 2.0 | Bollinger Bands deviations |
| InpKCLength | int | 20 | Keltner Channel length |
| InpKCMult | double | 1.5 | Keltner Channel width (x average range) |
| InpTrueRange | bool | true | Keltner range: true range (false = high - low) |
| InpSep2 | string | === Momentum === | ---- Momentum ---- |
| InpMomLength | int | 20 | Linear regression length of the momentum |
| InpSep3 | string | === Colours === | ---- Colours ---- |
| InpUpRising | color | clrLime | Momentum above zero and rising |
| InpUpFalling | color | clrGreen | Momentum above zero and falling |
| InpDownFalling | color | clrRed | Momentum below zero and falling |
| InpDownRising | color | clrMaroon | Momentum below zero and rising |
| InpSqzOn | color | clrOrangeRed | Dot: squeeze on (bands inside the channel) |
| InpSqzOff | color | clrLimeGreen | Dot: squeeze off (bands outside the channel) |
| InpNoSqz | color | clrDimGray | Dot: neither |
| InpSep4 | string | === Alerts === | ---- Alerts ---- |
| InpAlertFire | bool | false | Alert once when a closed bar ends a squeeze |

Tags: squeeze, squeeze-momentum, bollinger-bands, keltner-channel, volatility, momentum, indicator

Shared code is the author's work, not financial advice. Test on a demo account first.
