Kirshenbaum Bands
Bollinger-style sigma bands widen on any large price swing, whether that swing is a clean directional trend or pure chop - both produce a high standard deviation of price. Kirshenbaum Bands, attributed to Ken Kirshenbaum, use a different reference: a linear regression line fitted to closes over the lookback window, offset above and below by a multiple of the regression's standard error of estimate (the root- mean-square residual of closes away from that fitted line). The distinction matters because the two inputs answer different questions. Price standard deviation answers "how much has price moved". Regression standard error answers "how well does a straight line explain that move". A clean, orderly trend keeps closes tight against the fitted line even while price itself covers a lot of ground, so the bands stay narrow. Once bars start missing the trend line - the market starts chopping rather than trending, or a trend is about to change - the standard error grows and the bands widen, even if the day-to-day price range has not obviously changed. That separates "the trend is intact but moving fast" from "the trend itself is breaking down", which a plain volatility band cannot do. Notes and limitations - The regression line, midline and both bands are refit from scratch on every bar over the fixed window - there is no smoothing between bars beyond what the shared window provides. - The regression's standard error divides by (n-2); InpPeriod must be at least 4 for that to be meaningful, and the indicator enforces this at load. - Purely a visual channel - it does not classify "trending" versus "breaking down" itself, draw a signal arrow, or alert; the trader reads band width as the indicator is built for a discretionary read, not an automated trigger.
Indicator · MT4 · v1.0 · Free
About Kirshenbaum Bands
Kirshenbaum Bands is an indicator for MetaTrader 4. It has 2 settings, such as Period and Multiplier. MQL source code included.
Files in the download: KirshenbaumBands.ex4, KirshenbaumBands.mq4, KirshenbaumBands.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 20 | Regression / lookback window in bars |
| Multiplier | 1.6 | Standard-error multiple offset from the regression line |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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: Bollinger Bands · Trend · MT4 Indicator · MQL4 Source Code