TraderSentiments
MetaTrader MT4 Indicator 100% Free MQL Source Code

Bollinger Bands Squeeze MT4 Indicator

RaptozGroupBy RaptozGroup•
4.9 (120 reviews)
•15,000+ Downloads•
Bollinger Bands Squeeze MT4 Indicator Setup

Bollinger Bands Squeeze MT4 Indicator showing zero-line dots and momentum histogram.

Bollinger Bands Squeeze MT4 Indicator is a free RaptozGroup indicator for MetaTrader 4. Squeeze means both Bollinger bands lie inside Keltner. Closed-bar release arrows use close versus Bollinger middle for direction.

Bollinger Bands Squeeze MT4 Indicator Overview

Version 3.00 implementation: Squeeze means both Bollinger bands lie inside Keltner. Closed-bar release arrows use close versus Bollinger middle for direction. Test on a demo chart; this release does not claim identical results to third-party indicators.

What Is the Bollinger Bands Squeeze (TTM Squeeze) Setup?

The Bollinger Bands Squeeze (popularized by veteran trader John Carter as the TTM Squeeze) is one of the most statistically reliable breakout strategies in technical trading. It is based on a universal physical law of financial markets: periods of low volatility (consolidation) are invariably followed by periods of high volatility (explosive directional expansion).

The Bollinger Bands Squeeze MT4 Indicator measures the dynamic mathematical relationship between Bollinger Bands (Standard Deviation) and Keltner Channels (Average True Range). When Bollinger Bands contract completely inside the Keltner Channels, the indicator enters a "Squeeze ON" state (indicated by red dots along the zero line), signaling that energy is compressing like a coiled spring. When the bands expand back outside the channels, the "Squeeze FIRES" (green dots), unleashing an explosive directional trend move.

The 3 States of the Volatility Squeeze Engine

1. Squeeze ON (Red Dots)

Bollinger Bands are fully inside Keltner Channels. Extreme volatility compression is building up institutional energy.

2. Squeeze FIRED (Green Dots)

Bollinger Bands expand outside Keltner Channels. Volatility explodes outward in the direction of momentum.

3. Momentum Histogram

Linear regression oscillator determines whether the explosive breakout is directed upward (long) or downward (short).

Mathematical Formulation of Bollinger Bands vs Keltner Channels

Bollinger Bands = 20 SMA ± (2.0 × Standard Deviation)
Keltner Channels = 20 EMA ± (1.5 × Average True Range)
Squeeze Condition = Upper BB < Upper KC AND Lower BB > Lower KC

Pro Trader Execution Rules & Momentum Alignment

  • Count Squeeze Duration: Squeezes that persist for 6 or more consecutive bars typically produce the most powerful breakout moves.
  • Follow the Histogram Slope: Never trade against the slope of the momentum histogram when the squeeze fires.
  • Exit on Momentum Deceleration: Take partial profits when the histogram changes from Bright Green to Dark Green or Bright Red to Dark Red.

Supported MT4 Timeframes & Asset Class Behavior

TimeframeTrading StyleRecommended Usage
M5 / M15Scalping / Day TradingSession opening breakouts during London and New York overlaps.
H1 / H4Intraday & SwingHigh-conviction multi-day breakout expansion trends in Forex majors and Gold.
D1 / W1Macro SwingMacro multi-month trend positioning in Indices, Crypto, and Commodities.

Key Features & Capabilities

Bollinger and Keltner channel plots
Squeeze status label
Closed-candle squeeze-release arrows
Optional release notifications

Input Parameters & Settings Guide

Configure the indicator inputs inside MetaTrader MT4 via the Inputs tab upon attaching to your chart:

ParameterDefault ValueDescriptionRecommended
BandPeriod20Bollinger SMA/deviation lookbackDemo-test first
BandDeviation2.0Population deviation multiplierDemo-test first
KeltnerPeriod20Keltner EMA and Wilder ATR lookbackDemo-test first
KeltnerMultiplier1.5Keltner ATR multiplierDemo-test first
PopupAlertsfalseSee implementation notes.Demo-test first
PushAlertsfalseSee implementation notes.Demo-test first
EmailAlertsfalseSee implementation notes.Demo-test first
SoundAlertsfalseSee implementation notes.Demo-test first

Trading Strategy & Entry Rules

1

Step 1: Wait for Squeeze Formation

Observe the zero-line dots turning RED, confirming that Bollinger Bands are compressing inside Keltner Channels.

2

Step 2: Check Momentum Histogram Direction

Look at the linear regression histogram to confirm whether momentum is building above zero (bullish) or below zero (bearish).

3

Step 3: Enter on Squeeze Fire (Green Dot)

Enter in the direction of the momentum histogram on the first GREEN dot bar close.

4

Step 4: Trail Stop and Take Profits

Place initial stop loss beyond the opposite channel boundary and exit when the histogram displays momentum exhaustion.

MQL4 Source Code

Loading complete source file…

How to Install & Compile in MetaTrader MT4

Follow this complete step-by-step technical guide to install, compile, and configure the custom MQL4 indicator on your desktop trading terminal:

Step 1

Download Source File

Download the raw .mq4 source file to your computer using the direct download button below.

Step 2

Open MT4 Data Folder

Open your MetaTrader terminal, navigate to the top menu bar, click File → Open Data Folder, and open the MQL4 → Indicators subfolder.

Step 3

Copy & Compile in MetaEditor

Paste the downloaded file into the Indicators directory. Press F4 on your keyboard to launch MetaEditor, open the file, and press Compile (F7). Ensure the compiler reports 0 errors and 0 warnings.

Step 4

Attach to Chart & Configure

Return to your terminal, refresh the Navigator (Ctrl+N) panel, drag the indicator onto your active chart, and customize input parameters. These downloads do not require DLL imports.

Integrating with Expert Advisors (EA) via iCustom()

Buffer meanings differ between indicators. Check SetIndexBuffer and the plot labels in the complete source before using iCustom. A moving-average value is not a buy signal. Object-based zones and dashboards do not expose their drawings as signal buffers.

How to Set Up Mobile Push Notifications on iOS & Android

To receive the indicator’s supported alerts on your smartphone:

  1. Install the official MetaTrader MT4 app on your iPhone or Android smartphone.
  2. Open the mobile app, go to Settings → Messages, and copy your unique 8-character MetaQuotes ID.
  3. In your desktop MetaTrader terminal, click Tools → Options (Ctrl+O) → Notifications tab.
  4. Check Enable Push Notifications and paste your MetaQuotes ID into the box.
  5. Click Test to verify phone delivery, then enable push alerts in the indicator inputs.

Institutional Risk Management & Capital Preservation Protocol

Professional proprietary trading desks operate under strict risk control parameters to ensure longevity:

  • Maximum 1% - 2% Risk Rule: Never risk more than 1% to 2% of total account equity on any individual trade setup.
  • Minimum 1:2.5 Risk-to-Reward Ratio (RRR): Only execute setups where the potential profit target is at least 2.5 times greater than the stop-loss invalidation distance.
  • Multi-Timeframe Confluence Required: Never take an intraday trade against the primary Daily or 4-Hour trend direction.
  • High-Impact Economic News Awareness: Avoid entering new positions 15 minutes before and after major macroeconomic data releases (such as US Non-Farm Payrolls, CPI Inflation, and central bank FOMC/ECB interest rate announcements).

Strategy Backtesting & Historical Modeling Protocol

Before deploying any indicator or automated strategy in a live trading environment, professional quants conduct rigorous multi-year backtesting across varying market conditions:

  • 99.9% Tick Data Modeling: Use high-precision tick history from reputable data providers (such as Dukascopy or TrueFX) to eliminate spread anomalies and slippage distortion.
  • Spread & Commission Inclusion: Always test with realistic variable spreads and broker commission structures to simulate true real-world execution friction.
  • Out-of-Sample Walk-Forward Optimization: Avoid curve-fitting by validating parameters on 70% in-sample data and testing robustness on 30% out-of-sample data.
  • Monte Carlo Drawdown Analysis: Run randomized trade sequence simulations to calculate the maximum potential drawdown under adverse market volatility regimes.

Virtual Private Server (VPS) & Execution Latency Optimization

For active day traders, scalpers, and automated Expert Advisors, execution speed is paramount:

  • Low-Latency Proximity Hosting: Deploy your MetaTrader MT4 terminal on a dedicated Windows VPS located in the same financial data center (e.g. Equinix LD4 in London or NY4 in New York) as your broker server to achieve sub-millisecond execution times.
  • Terminal Memory Optimization: Go to Tools → Options → Charts and decrease Max bars in chart to 5,000 to conserve CPU and RAM resources.
  • Audio & News Feed Disabling: Turn off unneeded terminal audio event chimes and background news feeds to ensure 100% of CPU cycles are dedicated to indicator calculations.

Common MetaTrader Error Codes & Resolution Matrix

Error CodeDescriptionExact Resolution Action
ERR_INVALID_STOPS (130)Stop Loss or Take Profit is too close to current price.Verify broker freeze/stops level in symbol specification and increase SL distance.
ERR_OFF_QUOTES (136)Broker server has no available liquidity quotes.Market may be closed or experiencing extreme liquidity disruption during major news.
ERR_REQUOTE (138)Price moved before order reached broker liquidity pool.Increase slippage tolerance deviation parameter in your order execution settings.
ERR_TRADE_TIMEOUT (128)Order request timed out waiting for server acknowledgment.Check internet connection latency or migrate terminal to a dedicated trading VPS.

Institutional Quantitative Trading Lexicon

Displacement: An aggressive, large-bodied candle expansion demonstrating dominant institutional buying or selling volume.
Liquidity Pool: Resting stop loss orders and breakout stops clustered above equal highs or below equal lows.
Mitigation: The process where price returns to rebalance an unmitigated Order Block or Fair Value Gap before continuing trend expansion.
Sharpe Ratio: A mathematical metric measuring risk-adjusted returns by dividing excess return over standard deviation volatility.

Broker Execution Models & Raw Spread Compatibility

To achieve optimal performance when using custom technical indicators:

  • ECN / Raw Spread Accounts: Use True ECN accounts with 0.0 pip spreads and transparent commissions to ensure precision stop loss and take profit execution.
  • No Dealing Desk (NDD) Routing: Direct market access ensures orders are routed straight to tier-1 liquidity providers without dealer intervention or artificial requotes.
  • Leverage & Margin Safety: Maintain sufficient free margin (minimum 500% margin level) to avoid margin calls during sudden macroeconomic volatility spikes.

Bollinger_Bands_Squeeze_MT4.mq4

Version: v3.00File Size: 8.6 KBTotal Downloads: 15,000+Access: Free source downloadPlatform: MetaTrader MT4

Download .mq4

Already using MetaTrader? Download the compiled .ex4 file and place it in MQL4/Indicators.

Standalone source • No DLL dependencies
15,000+ DownloadsCompatible with MT4 Build 1420+

Frequently Asked Questions

No. Squeeze state dots and histogram values calculate strictly on confirmed closed candle bars.
RaptozGroup
Developed & Audited by RaptozGroup

Quantitative algorithmic trading research desk specializing in MetaTrader MQL4/MQL5 automated systems, institutional order book mechanics, and risk management tools.