On this page
One filter for volatility, another for the histogram
Bollinger Squeeze Advanced combines a Bollinger/Keltner width ratio with one of eight native oscillators. Wide blue bars mark a width squeeze; outside it, positive values are green and nonpositive values red. The height belongs to the selected oscillator. A blue bar is not a breakout direction, and the source labels “Trending” and “Sideways” are classifications rather than proof of a market regime.
ForexBestRobots edition 1.02 is a marked Apache 2.0 derivative of EarnForex 1.01. It makes the exposed MACD periods effective, aligns MT5 Stochastic with MT4 Low/High, repairs source-timeframe alert selection and guards missing data and handles. All 20 input names and defaults remain. The shared reference line is zero; the original mode-specific auxiliary levels are removed. Original authorship and the complete license are retained.
The exact squeeze ratio, eight modes and source candles
The fixed formula is R=2×σ(Close,20)/(1.5×ATR20), using population standard deviation around SMA20 and native ATR20. R<1 is a squeeze; R=1 is already outside. The independent chart model uses the published rolling-simple ATR formula. This is a width comparison without testing the two channel centres. It is not the formula of the separately downloadable classic Keltner Channel. BB20/2 and ATR20/1.5 are internal constants, not adjustable inputs. ATR≤0 or unavailable values produce empty output.
TriggerType selects Stochastic main %K(14,3,3,SMA,Low/High)−50; Close CCI50; Close RSI14−50; MACD main EMA12−EMA26(Close), with a separate native SMA9 signal; Close Momentum14−100; Williams %R24+50; uncentred ADX14 main; or DeMarker13−0.5, the default. MACD is Main, not Main minus Signal. The legacy name MACDMACDEMAPeriod controls the native signal period despite “EMA” in its name. Each mode uses its own units and only its relevant period inputs.
DeMarker compares positive increases of successive Highs and positive decreases of successive Lows. Their rolling sums give DeMax/(DeMax+DeMin), then the source subtracts 0.5. Positive and negative values describe that balance. ADX is different: its main value is nonnegative strength, not direction, so green outside the squeeze does not identify a bullish market. A zero-height histogram is valid zero, not a buy/sell code.
InpTimeframe=PERIOD_CURRENT follows the chart; a lower selected timeframe is clamped to the chart timeframe. Higher-timeframe data are projected using source timestamps. Their current bucket can revise all corresponding lower-timeframe bars. TriggerCandle=Previous reads source shift 1 for alerts; Current reads source shift 0. It selects alert data and does not freeze the plotted histogram. Weekend gaps and timeframe encodings are not treated as fixed candle-count multipliers.
20 inputs: defaults, active mode and notification gates
All 20 controls are functional; there are no Comment separators. Periods must be positive, MACD fast must be smaller than slow, and finite AlertBelowLevel must not exceed AlertAboveLevel. Warmup uses complete source windows. Changing a period for an inactive mode does not change the current histogram.
| Input | Default | Practical meaning |
|---|---|---|
InpTimeframe | PERIOD_CURRENT | Source timeframe, PERIOD_CURRENT. A selection below the chart timeframe is raised to the chart timeframe. |
TriggerType | DeMarker | Histogram source, DeMarker by default. Choose one of eight modes; their scales and meaning differ. |
StochasticPeriod | 14 | Stochastic %K lookback, 14. %D=3, slowing=3, SMA and Low/High are fixed in this edition. |
CCIPeriod | 50 | CCI lookback, 50, applied to Close rather than Typical price. |
RSIPeriod | 14 | RSI lookback, 14 on Close; the displayed value is RSI−50. |
MACDFastEMAPeriod | 12 | Fast MACD EMA period, 12. This edition actually passes it to the native main/signal calculation. |
MACDSlowEMAPeriod | 26 | Slow MACD EMA period, 26; must exceed fast. |
MACDMACDEMAPeriod | 9 | MACD signal period, 9. Native MACD uses an SMA signal; the legacy input name is unchanged. |
MomentumPeriod | 14 | Momentum lookback, 14 on Close; displayed value is Momentum−100. |
WilliamsPRPeriod | 24 | Williams %R lookback, 24; the display adds 50. |
ADXPeriod | 14 | ADX lookback, 14. Native main strength remains uncentred and does not supply direction. |
DeMarkerPeriod | 13 | DeMarker lookback, 13; the displayed value subtracts 0.5. |
AlertOnSidewaysTrending | false | Enable squeeze/outside-state notifications, false. Also requires at least one delivery channel. |
AlertOnZeroCross | false | Enable remembered threshold-side notifications, false. Levels below can replace zero. |
AlertAboveLevel | 0 | Strict upper threshold, 0, in the selected oscillator’s units. Equality does not qualify. |
AlertBelowLevel | 0 | Strict lower threshold, 0. Keep it ≤ the upper level; equality/deadband preserves prior side. |
EnableNativeAlerts | false | Terminal popup channel, false. Enable a notification family as well. |
EnableEmailAlerts | false | Email channel, false; needs terminal email configuration. |
EnablePushAlerts | false | Push channel, false; needs terminal Notifications configuration. |
TriggerCandle | Previous | Alert source candle, Previous by default: closed source shift 1; Current uses forming source shift 0. Does not lock plots. |
Real EUR/USD: width regimes and different oscillator scales
These original figures use archived Yahoo Finance EURUSD=X H1 OHLC in UTC. The panels reconstruct a population-standard-deviation/rolling-ATR width ratio and centred DeMarker; the comparison adds Wilder RSI. They show completed-OHLC values rather than terminal screenshots, tick arrival or executed trades.



Provider OHLC are not identified broker-specific Bid/Ask fills. CSV files contain the plotted OHLC, width ratio, DeMarker and RSI values, with zero for inactive histogram branches. No spread, execution cost, return or first intrabar event is measured. Independent oscillator seed/flat conventions are not native certification. Scroll horizontally on small screens.
Download chart calculation data (CSV) · 1Download chart calculation data (CSV) · 2
Two event families, strict thresholds and remembered states
AlertOnSidewaysTrending=false and AlertOnZeroCross=false; EnableNativeAlerts, EnableEmailAlerts and EnablePushAlerts are all false. Enable at least one family and one channel. There is no separate master, sound input or wait-time control. Configure email/push in the terminal. Messages identify BSA, symbol and source timeframe; they do not include account name or number.
The first valid calculation initializes state and sends nothing. A family then suppresses its repeated side until the eligible opposite state is observed. Threshold tests are strictly d>AlertAboveLevel and d<AlertBelowLevel. Equality or the gap between levels keeps the previous side; this is remembered-state logic, not a requirement for two adjacent candles to straddle zero. For regime alerts, d=0 gives no qualifying visible histogram branch and does not reset the remembered regime.
Regime and threshold families are independent, so one calculation may produce two messages. There is no per-bar lock or cooldown; Current can alternate intrabar. Previous uses the closed source candle, without replaying historical alerts. Delivery failure still consumes the changed state; reattaching or a full history reset initializes it again. Historical bars do not prove when a notification was delivered.
Compile the source for your desktop platform
Choose MQ4 for MT4 or MQ5 for MT5. Both modified packages are source-only, without a ready modified EX4/EX5. They need no external include, icon or DLL.
- Download and extract the matching platform ZIP.
- In MetaTrader: File → Open Data Folder → MQL4 or MQL5.
- Copy the Indicators folder there; upstream is unchanged reference source.
- Open Bollinger_Squeeze_Advanced_ForexBestRobots.mq4 or .mq5 in the matching MetaEditor, Compile with F7 and inspect errors.
- Refresh Navigator → Indicators, attach to a demo chart, compare modes and source timeframes, then inspect buffers and Experts/Journal before enabling channels.
ForexBestRobots has not compiled or executed these sources in MetaTrader. Independent numerical, index and notification models do not replace native testing of handles, iCustom reads, live MTF updates or delivery. Compile and test on demo first.
Download Bollinger Squeeze Advanced free
Each ZIP contains marked modified source, untouched original reference source, full Apache 2.0 license, change log, patch, installation notes and SHA-256 checksums. No registration or broker account is needed to download.
ForexBestRobots 1.02 identifies our derivative of EarnForex 1.01. Original source matches the pinned repository and the official matching-platform archive byte for byte. Modifications are marked; original notices remain. Compile the modified source, whose behavior is not represented by an original compiled binary.
Free source ZIP · ForexBestRobots 1.02 · Compile in MetaEditor
Live revisions, platform buffers and what the checks establish
The current source candle can change. In MTF mode its final histogram may be projected across earlier lower-timeframe candles; treating those final values as already known would introduce hindsight. Previous changes alert selection only. Broker sessions, initialization, history corrections and platform indicator implementations can produce differences. Reattach after a history edit that the terminal has not signalled.
Buffer layout is platform-specific. MT4: 0 positive outside, 1 nonpositive outside, 2 positive squeeze, 3 nonpositive squeeze, 4 MACD signal, 5 raw centred d. MT5: 0 signed outside, 1 colour index (0 green/1 red), 2 signed squeeze, 3 MACD signal, 4 raw d. Valid inactive histograms are 0; unavailable readings are EMPTY_VALUE, as is the signal outside MACD mode. Colour indexes are not trading directions; there is no universal 1/−1 signal buffer.
The source guards windows and division, checks exact MT5 copies, releases handles and refreshes live source buckets. Independent direct/pandas calculations and source-state models do not compile MQL or certify native initialization, flat-market conventions, tick paths, EA integration, delivery or profitability. Squeeze release alone does not provide an entry, stop or position size.
Frequently asked questions
Do blue bars predict a breakout direction?
No. R<1 compares widths. Direction-like height comes from the selected oscillator, and the default DeMarker balance does not guarantee a later price move.
Why does ADX stay above zero?
This mode uses uncentred native ADX main strength. It is not +DI minus −DI, so a green bar does not mean bullish direction.
Does Previous stop all MTF repainting?
It chooses closed source shift 1 for alerts. The current source bucket can still revise its projected lower-timeframe plot, and corrected history can change readings.
Why are there no alerts?
Both event families and all three channels are off by default. Enable a family plus a configured channel; the first valid reading only initializes state.
Can an EA treat buffer 1 as a sell signal?
No. In MT5 buffer 1 is a colour index; MT4 has a different layout. Read the documented platform buffers, handle EMPTY_VALUE and test native iCustom behavior on demo.
Sources and review scope
The original source and license are pinned to an EarnForex revision. The review separates retained rules, marked repairs and independent OHLC illustrations. Agreement between our models does not certify native MetaTrader execution.