TTM Squeeze vs MACD: Comparing Powerful Momentum Indicators
Discover how these two popular momentum indicators work, their key differences, and how to effectively combine them for more precise trade entries and exits.
Understanding the Power Behind TTM Squeeze and MACD
In the world of technical analysis, momentum indicators serve as essential tools for traders seeking to capture profitable moves while minimizing false signals. Among these indicators, the TTM Squeeze and MACD stand out for their unique approaches to measuring momentum and identifying potential trading opportunities. This lesson explores both indicators in depth, highlighting their differences, strengths, and how they can be strategically combined.
The TTM Squeeze: Capturing Price Compression
Developed by John Carter, the TTM (Time to Move) Squeeze is a powerful volatility and momentum indicator designed to identify periods of market consolidation and subsequent explosive moves. It combines the principles of Bollinger Bands and Keltner Channels to detect when price is "squeezed" or compressed.
TTM Squeeze Key Components:
• Bollinger Bands®: Standard deviation-based bands that expand and contract with market volatility
• Keltner Channels: ATR-based channels that remain more consistent in width
• Histogram: Visual representation of momentum with color-coded signals
• Dots: Indicators of the "squeeze" state (on/off)
How the TTM Squeeze Works
The TTM Squeeze operates on a simple yet profound premise: markets alternate between periods of consolidation (low volatility) and expansion (high volatility). When Bollinger Bands contract inside Keltner Channels, a "squeeze" is identified, signaling potential energy building up for a subsequent price move.
Squeeze OFF = Bollinger Bands (2 standard deviations) > Keltner Channels (1.5 × ATR)
The momentum histogram accompanying the squeeze dots shows the direction and strength of momentum:
- Green Histogram: Rising momentum (bullish)
- Red Histogram: Falling momentum (bearish)
- Black Dots: Squeeze is ON (consolidation)
- Blue/White Dots: Squeeze is OFF (volatility expansion)
// Pine Script for TTM Squeeze (simplified version)
length = input(20, "BB Length")
mult = input(2.0, "BB Multiplier")
lengthKC = input(20, "KC Length")
multKC = input(1.5, "KC Multiplier")
// Calculate Bollinger Bands....
source = close
basis = sma(source, length)
dev = multKC * stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev
// Calculate Keltner Channel
ma = sma(source, lengthKC)
range = tr
rangema = sma(range, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC
sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC)
sqzOff = (lowerBB < lowerKC) or (upperBB > upperKC)
noSqz = (sqzOn == false) and (sqzOff == false)
// Momentum
val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)), sma(close, lengthKC)),
lengthKC, 0)
// Plotting
plot(val, "Momentum", val >= 0 ? color.green : color.red, 2)
plotshape(sqzOn and val > 0, "Squeeze On - Bullish", shape.square, location.bottom, color.green)
plotshape(sqzOn and val < 0, "Squeeze On - Bearish", shape.square, location.bottom, color.red)
plotshape(sqzOff and val > 0, "Squeeze Off - Bullish", shape.circle, location.bottom, color.lime)
plotshape(sqzOff and val < 0, "Squeeze Off - Bearish", shape.circle, location.bottom, color.maroon)
MACD: The Classic Momentum Indicator
The Moving Average Convergence Divergence (MACD), developed by Gerald Appel in the late 1970s, is a trend-following momentum indicator that shows the relationship between two moving averages of a security's price.
MACD Key Components:
• MACD Line: The difference between the 12-period and 26-period Exponential Moving Averages (EMAs)
• Signal Line: 9-period EMA of the MACD Line
• Histogram: The difference between the MACD Line and Signal Line
• Zero Line: The center line where the two original EMAs are equal
How MACD Works
MACD measures momentum by tracking the convergence and divergence of two moving averages, generating signals through line crossovers and histogram changes.
Signal Line = EMA(9) of MACD Line
Histogram = MACD Line - Signal Line
Common MACD signals include:
- Bullish Signal: MACD Line crosses above Signal Line
- Bearish Signal: MACD Line crosses below Signal Line
- Bullish Divergence: Price makes lower lows while MACD makes higher lows
- Bearish Divergence: Price makes higher highs while MACD makes lower highs
- Zero Line Cross: MACD crossing above/below zero indicates trend direction
// MQL5 code for MACD
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
// MACD parameters
int fast_ema_period = 12;
int slow_ema_period = 26;
int signal_period = 9;
// Array for indicator values
double macd_main[]; // MACD line
double macd_signal[]; // Signal line
double macd_histogram[]; // Histogram
// Allocate arrays
ArraySetAsSeries(macd_main, true);
ArraySetAsSeries(macd_signal, true);
ArraySetAsSeries(macd_histogram, true);
ArrayResize(macd_main, rates_total);
ArrayResize(macd_signal, rates_total);
ArrayResize(macd_histogram, rates_total);
// Get MACD values using built-in function
int macd_handle = iMACD(Symbol(), Period(), fast_ema_period, slow_ema_period, signal_period, PRICE_CLOSE);
// Copy MACD values to arrays
CopyBuffer(macd_handle, 0, 0, rates_total, macd_main); // MACD line
CopyBuffer(macd_handle, 1, 0, rates_total, macd_signal); // Signal line
// Calculate histogram
for(int i = 0; i < rates_total; i++)
{
macd_histogram[i] = macd_main[i] - macd_signal[i];
}
// Process signals here
return(rates_total);
}
TTM Squeeze vs MACD: Key Differences
| Aspect | TTM Squeeze | MACD |
|---|---|---|
| Primary Function | Identifies periods of low volatility followed by expansion | Identifies trend direction and momentum shifts |
| Components | Bollinger Bands, Keltner Channels, momentum histogram | Fast EMA, slow EMA, signal line, histogram |
| Best For | Breakout trading, volatility expansion plays | Trend following, momentum confirmation |
| Signal Frequency | Less frequent (consolidation-expansion cycles) | More frequent (multiple crossovers) |
| Market Conditions | Performs well in both trending and ranging markets | Performs best in trending markets, less reliable in ranges |
| Lag | Moderate lag, but typically signals before big moves | More lagging due to multiple moving averages |
| Signal Clarity | Clear visual signals (dots + histogram colors) | Requires interpretation of line crossovers and divergences |
| Customization | Moderate (band width, ATR multiplier, lookback) | Simple (adjusting period lengths) |
5 Strategic Ways to Combine TTM Squeeze and MACD
1. High-Probability Entry Strategy
Use TTM Squeeze to identify potential breakout moments, then confirm direction with MACD crossovers for entry timing.
Example: Enter long when TTM Squeeze dots turn from black to blue/white (squeeze release) AND the MACD line crosses above the signal line. This combines the squeeze's explosive move with MACD's bullish momentum confirmation.
2. Trend Confirmation System
Leverage MACD for overall trend direction, then use TTM Squeeze for precise entry points within that trend.
Example: When MACD histogram is positive and above zero line (bullish trend), look for TTM Squeeze releases with green histogram for high-probability long entries in the direction of the established trend.
3. Divergence Detection System
Identify potentially powerful reversals by looking for divergences in both indicators simultaneously.
Example: When price makes a new high but both TTM Squeeze momentum histogram and MACD show lower highs (bearish divergence), prepare for a potential trend reversal. This dual confirmation provides stronger evidence than either indicator alone.
4. Volatility-Based Position Sizing
Use TTM Squeeze to assess potential volatility expansion while using MACD for directional bias in position sizing decisions.
Example: Size positions larger when TTM Squeeze indicates a prolonged squeeze (more potential energy) AND MACD shows strong momentum in your trade direction. Reduce position size when indicators are misaligned.
5. Risk Management Framework
Create a dynamic exit strategy based on the combined signals from both indicators.
Example: For long positions, consider partial profit-taking when TTM momentum histogram starts decreasing in height while maintaining the position until MACD crosses below signal line for final exit. This approach captures more of the move than using either indicator alone.
Implementing a Combined TTM Squeeze and MACD Strategy
Here's a practical example of how to implement a combined TTM Squeeze and MACD strategy in MQL5:
// Combined TTM Squeeze and MACD Trading System
input int BBLength = 20; // Bollinger Bands length
input double BBMultiplier = 2.0; // Bollinger Bands multiplier
input int KCLength = 20; // Keltner Channel length
input double KCMultiplier = 1.5; // Keltner Channel multiplier
input int MACDFastPeriod = 12; // MACD fast EMA period
input int MACDSlowPeriod = 26; // MACD slow EMA period
input int MACDSignalPeriod = 9; // MACD signal period
input double RiskPercent = 1.0; // Risk percentage per trade
// Global variables
double bb_upper[], bb_lower[], kc_upper[], kc_lower[];
double macd_main[], macd_signal[], macd_histogram[];
double momentum[];
bool squeeze_on;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ArraySetAsSeries(bb_upper, true);
ArraySetAsSeries(bb_lower, true);
ArraySetAsSeries(kc_upper, true);
ArraySetAsSeries(kc_lower, true);
ArraySetAsSeries(macd_main, true);
ArraySetAsSeries(macd_signal, true);
ArraySetAsSeries(macd_histogram, true);
ArraySetAsSeries(momentum, true);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// Calculate indicators
CalculateIndicators();
// Check for trading signals
CheckTradingSignals();
}
//+------------------------------------------------------------------+
//| Calculate TTM Squeeze and MACD indicators |
//+------------------------------------------------------------------+
void CalculateIndicators()
{
int rates_total = Bars(Symbol(), Period());
// Resize arrays
ArrayResize(bb_upper, rates_total);
ArrayResize(bb_lower, rates_total);
ArrayResize(kc_upper, rates_total);
ArrayResize(kc_lower, rates_total);
ArrayResize(macd_main, rates_total);
ArrayResize(macd_signal, rates_total);
ArrayResize(macd_histogram, rates_total);
ArrayResize(momentum, rates_total);
// Bollinger Bands
int bb_handle = iBands(Symbol(), Period(), BBLength, 0, BBMultiplier, PRICE_CLOSE);
CopyBuffer(bb_handle, 1, 0, rates_total, bb_upper);
CopyBuffer(bb_handle, 2, 0, rates_total, bb_lower);
// Keltner Channels
int kc_handle = iKeltner(Symbol(), Period(), KCLength, KCMultiplier);
CopyBuffer(kc_handle, 1, 0, rates_total, kc_upper);
CopyBuffer(kc_handle, 2, 0, rates_total, kc_lower);
// MACD
int macd_handle = iMACD(Symbol(), Period(), MACDFastPeriod, MACDSlowPeriod, MACDSignalPeriod, PRICE_CLOSE);
CopyBuffer(macd_handle, 0, 0, rates_total, macd_main);
CopyBuffer(macd_handle, 1, 0, rates_total, macd_signal);
// Calculate histogram
for(int i = 0; i < rates_total; i++)
{
macd_histogram[i] = macd_main[i] - macd_signal[i];
}
// Calculate TTM Squeeze momentum
for(int i = 0; i < rates_total; i++)
{
double avg_high_low = (iHigh(Symbol(), Period(), i) + iLow(Symbol(), Period(), i)) / 2;
double sma_close = iMA(Symbol(), Period(), KCLength, 0, MODE_SMA, PRICE_CLOSE);
momentum[i] = iLinearRegression(Symbol(), Period(), KCLength, 0, PRICE_CLOSE) - avg_high_low;
}
// Check squeeze condition
squeeze_on = (bb_lower[1] > kc_lower[1]) && (bb_upper[1] < kc_upper[1]);
}
//+------------------------------------------------------------------+
//| Check for trading signals |
//+------------------------------------------------------------------+
void CheckTradingSignals()
{
// Check for long entry
if(!squeeze_on && macd_main[1] > macd_signal[1] && macd_main[2] <= macd_signal[2] && momentum[1] > 0)
{
double sl = iLow(Symbol(), Period(), 1);
double tp = iClose(Symbol(), Period(), 1) + (iClose(Symbol(), Period(), 1) - sl) * 2;
double lot_size = CalculateLotSize(RiskPercent, sl);
trade.Buy(lot_size, Symbol(), 0, sl, tp);
}
// Check for short entry
if(!squeeze_on && macd_main[1] < macd_signal[1] && macd_main[2] >= macd_signal[2] && momentum[1] < 0)
{
double sl = iHigh(Symbol(), Period(), 1);
double tp = iClose(Symbol(), Period(), 1) - (sl - iClose(Symbol(), Period(), 1)) * 2;
double lot_size = CalculateLotSize(RiskPercent, sl);
trade.Sell(lot_size, Symbol(), 0, sl, tp);
}
}
//+------------------------------------------------------------------+
//| Calculate lot size based on risk percentage |
//+------------------------------------------------------------------+
double CalculateLotSize(double risk_percent, double stop_loss)
{
double account_balance = AccountBalance();
double pip_value = MarketInfo(Symbol(), MODE_TICKVALUE);
double stop_loss_pips = MathAbs(iClose(Symbol(), Period(), 1) - stop_loss) / Point;
double risk_amount = account_balance * risk_percent / 100;
double lot_size = risk_amount / (stop_loss_pips * pip_value);
return NormalizeDouble(lot_size, 2);
}
Conclusion
Both the TTM Squeeze and MACD are powerful momentum indicators with unique strengths. The TTM Squeeze excels at identifying breakout opportunities during periods of low volatility, while the MACD provides reliable trend-following signals. By combining these indicators, traders can create a robust trading system that leverages volatility expansion and momentum confirmation for higher-probability trades.
Experiment with the provided strategies and code to tailor the system to your trading style, and always backtest thoroughly before deploying in live markets.
Key Takeaways:
- TTM Squeeze identifies low volatility periods and potential breakouts.
- MACD confirms trend direction and momentum shifts.
- Combining both indicators enhances entry and exit precision.
- Use backtesting to validate strategies before live trading.