Build a powerful TTM Squeeze trend indicator combining stacked moving averages with squeeze detection to find high-probability trend continuation setups.
Download IndicatorIn this beginner-friendly tutorial, I’ll show you how to build a powerful TTM Squeeze trend indicator that combines the power of squeeze compression detection, with trend confirmation. We will use Stacked Moving Averages to find the strongest trends.
This beginner-friendly tutorial teaches you to create an indicator that:
Perfect for traders who want to master TTM squeeze analysis while ensuring trend alignment, reducing false signals and improving win rates on breakout trades.
Most traders use the TTM squeeze by itself and wonder why half their signals fail. The problem isn’t the squeeze – it’s ignoring the trend. When you combine TTM squeeze detection with stacked moving averages, you filter out the junk setups and focus on squeezes that actually work.
Here’s what happens: the regular TTM squeeze fires on any compression-release cycle, whether the stock is trending up, down, or sideways. But squeezes in trending markets work differently. They tend to break in the trend direction with more follow-through. Sideways market squeezes? They’re usually head-fakes.
The TTM squeeze finds low volatility periods by comparing Bollinger Bands to Keltner Channels. When the bands contract inside the channels, you get compression (red dots). When they expand back outside, the squeeze fires (green dots). Simple enough.
But here’s what John Carter doesn’t tell you in his marketing: not all squeezes are worth trading. A squeeze in a strong uptrend usually breaks higher. A squeeze in a choppy sideways market could break either way – or fake you out completely.
That’s where stacked moving averages come in. When your EMAs and SMAs line up properly (3>8>21>34>50>200 for bullish), you know the trend is healthy. Combine that with a squeeze, and now you’ve got a setup with an edge.
We use six moving averages to define our trend: 3, 8, 21, and 34 EMAs, plus 50 and 200 SMAs. For a bullish trend, they need to stack in order from fastest to slowest. For bearish, reverse it.
Why these specific periods? The shorter EMAs (3, 8) catch momentum changes quickly. The 21 and 34 EMAs smooth out noise but still respond to real moves. The 50 and 200 SMAs give you the bigger picture trend context.
The stacking requirement seems strict, but it works. When all these averages align, you’re not fighting the trend. When they’re tangled up, stay away – the market doesn’t know what it wants to do.
You can make the trend check as tight or loose as you want. Remove the 200 SMA requirement for more signals. Add volume confirmation for higher quality. The framework adapts to your style.
ThinkOrSwim has the TTM squeeze built right in. We just reference the squeeze alert – it returns 0 when squeezed (red dots) and something else when not squeezed (green dots).
The squeeze required input lets you turn the squeeze filter on or off. Sometimes the market is trending so clearly that you don’t need to wait for compression. Other times, you only want the highest-probability squeeze setups.
When the squeeze is active, our indicator waits for momentum confirmation before plotting arrows. This prevents false signals from squeezes that fire but immediately fail. We want squeeze releases with follow-through, not one-bar wonders.
The 3 EMA crossing the 8 EMA gives us momentum confirmation. When the 3 crosses above the 8 while our other conditions are met, that’s a bullish signal. Cross below for bearish signals.
This crossover happens right as momentum shifts in the trend direction. You’re not too early (missing the move) or too late (chasing). The timing usually gets you in just as the squeeze release gains steam.
We also check that price pulled back into the EMA stack. If price is extended far from the 8 EMA, we skip the signal. We want entries near the moving averages where we can use them as logical stops.
The indicator plots arrows when all conditions line up. Green arrows for bullish signals, red for bearish. Big enough to see clearly, but not so big they mess up your chart.
The moving averages are optional – turn them on to see the trend structure or off to keep your chart clean. Different colors and line styles make them easy to distinguish.
Chart bubbles show the signal type on the last bar. Useful if you’re scanning multiple charts or want to quickly identify what triggered.
Day traders can speed things up by using just the 3, 8, and 21 EMAs. Fewer moving averages mean faster signals, which works better for short-term trading.
Swing traders usually want the full stack plus tighter squeeze requirements. You’re looking for higher-quality setups that can run for days or weeks.
Position traders might extend the SMAs to 100 and 200 periods and require multiple consecutive squeeze dots. This filters for major compression-expansion cycles that produce bigger moves.
The squeeze toggle is handy during different market phases. In strong trends, turn off the squeeze requirement and trade pure momentum. In choppy markets, keep it on to avoid the noise.
These setups shine during earnings season. Stocks compress before announcements, then explode afterward. The trend component tells you which way they’re likely to break.
Sector rotation creates great opportunities too. As money moves between sectors, strong stocks pull back briefly before resuming their trends. Perfect conditions for squeeze trend signals.
Bull markets favor bullish squeeze trend setups, bear markets favor bearish ones. Sounds obvious, but traders forget this and wonder why their counter-trend signals keep failing.
Squeeze releases can be violent. Size down compared to your normal trades because volatility spikes when compression releases.
Use the moving averages for stops. Bullish trades can use the 8 EMA for aggressive stops or the 21 EMA for more room. The trend structure gives you logical exit levels.
Take some profits early. Squeeze moves often thrust hard initially, then consolidate. Bank some gains on the first push, then let the rest run with trailing stops.
Start each day by checking the overall market trend. Are the major indices in healthy uptrends or downtrends? This gives you context for individual setups.
During market hours, let the indicator do its job. When arrows appear, check the setup quality. Is the trend clean? Did the squeeze build over multiple bars? Is the stock leading its sector?
After hours, review what worked and what didn’t. Keep notes on setup quality and outcomes. Over time, you’ll develop an eye for the best TTM squeeze trend opportunities.
Remember: this isn’t a magic bullet that works every time. It’s a tool that tilts the odds in your favor by combining two powerful concepts – trend following and volatility compression. Use it as part of a complete trading plan, not as a standalone system.
#TOS Indicators
#Home of the Volatility Box 2024
#Indicator: Trend Squeeze Indicator
#Full Tutorial: https://www.tosindicators.com/indicators/trend-squeeze
#Healthy Trend
#3EMA > 8EMA > 21 EMA > 34 EMA > 50 SMA > 200 SMA
input showLines = yes;
input squeezeRequired = yes;
def EMA3 = ExpAverage(close, 3);
def EMA8 = ExpAverage(close, 8);
def EMA21 = ExpAverage(close, 21);
def EMA34 = ExpAverage(close, 34);
def SMA50 = SimpleMovingAvg(close, 50);
def SMA200 = SimpleMovingAvg(close, 200);
plot EMA3Plot = if showLines then EMA3 else double.nan;
EMA3Plot.setDefaultColor(Color.Pink);
plot EMA8Plot = if showLines then EMA8 else double.nan;
EMA8Plot.setDefaultColor(Color.Cyan);
plot EMA21Plot = if showLines then EMA21 else double.nan;
EMA21Plot.setDefaultColor(Color.Magenta);
plot EMA34Plot = if showLines then EMA34 else double.nan;
EMA34Plot.setDefaultColor(Color.Yellow);
plot SMA50Plot = if showLines then SMA50 else double.nan;
SMA50Plot.setDefaultColor(Color.Yellow);
SMA50Plot.SetStyle(Curve.Short_Dash);
plot SMA200Plot = if showLines then SMA200 else double.nan;
SMA200Plot.setDefaultColor(Color.White);
SMA200Plot.SetStyle(Curve.Short_Dash);
def bullTrendCheck = EMA3 > EMA8 and EMA8 > EMA21 and EMA21 > EMA34 and EMA34 > SMA50 and SMA50 > SMA200;
def bearTrendCheck = EMA3 < EMA8 and EMA8 < EMA21 and EMA21 < EMA34 and EMA34 < SMA50 and SMA50 < SMA200;
def bullMomentumCross = EMA3 > EMA8 and EMA3[1] = EMA8[1];
def squeezeAlert = if TTM_Squeeze().SqueezeAlert == 0 then 1 else 0;
def squeezeCheck = if squeezeRequired and squeezeAlert then 1 else if !squeezeRequired then 1 else 0;
plot bullSignal = if bullTrendCheck and squeezeCheck and bullMomentumCross and low < EMA8 then 1 else double.nan;
bullSignal.setPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);
bullSignal.setDefaultColor(Color.Cyan);
bullSignal.setLineWeight(3);
plot bearSignal = if bearTrendCheck and squeezeCheck and bearMomentumCross and high > EMA8 then 1 else double.nan;
bearSignal.setPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);
bearSignal.setDefaultColor(Color.Pink);
bearSignal.setLineWeight(3);Want the .ts file and the one-click import? Both come with a free account.
Here are some resources that you may find useful:
Join 40,000+ traders using institutional-grade tools for ThinkOrSwim.
Get the Bundle