Skip to main content TTM Squeeze Scanner For ThinkOrSwim Skip to main content Skip to content
Master the TTM Squeeze with our comprehensive 19-module course Start Learning →
TOS Indicators
  • Tools

    Categories

    • Indicators
    • Backtesters
    • Scans
    • Dashboards
    • thinkScript
    • Member Resources
    Browse Full Library

    Featured Tutorials

    Heiken Ashi Trend Indicator
    Heiken Ashi Trend Indicator
    Indicators

    Download our Custom Heiken Ashi indicator for ThinkOrSwim. Full ThinkScript code, formula...

    Learn more →
    Commodities Tracker
    Commodities Tracker
    Indicators

    For acceleration signals: trend-following strategies and buying pullbacks. For deceleration signals: short...

    Learn more →
    Build an Election Backtester in 10 Minutes
    Build an Election Backtester in 10 Minutes
    Backtesters

    Learn how to create a Post-Election Backtester in ThinkOrSwim to analyze market...

    Learn more →

    Popular Posts

    Unusual Volume
    Unusual Volume
    Scans

    Build 4 scans to easily find stocks with greater than...

    Learn more →
    Upcoming Earnings with High Short Interest
    Upcoming Earnings with High Short Interest
    Scans

    Build a scan to find stocks that are likely to...

    Learn more →
    Unusual Volume Pro Scans
    Unusual Volume Pro Scans
    Scans

    4 additional scans to find unusual volume overlapping with key...

    Learn more →
  • Courses
    Squeeze Course
    Squeeze Course
    19 Modules

    Scan, backtest, and trade the TTM Squeeze setup with precision.

    Unlock Course →
    Earnings Course
    Earnings Course
    3 Modules

    Master earnings plays with free indicators and proven strategies for ThinkOrSwim.

    Unlock Course →
    V-Shaped Reversals
    V-Shaped Reversals
    7 Modules

    Identify and trade powerful V-shaped reversal patterns with confidence and precision.

    Unlock Course →
    Fibonacci Trading
    Fibonacci Trading
    4 Modules

    Learn to trade Fibonacci retracements and extensions in ThinkOrSwim effectively.

    Unlock Course →
  • Products
    Futures Volatility Box Premium
    Futures Volatility Box

    Volatility models for 10 major futures markets, including micros & SPX.

    Explore Futures VB →
    Stock Volatility Box Premium
    Stock Volatility Box

    Dynamic support & resistance for 595+ stocks/ETFs, with a live scanner.

    Explore Stock VB →
    Opening Range Breakouts Premium
    Opening Range Breakouts

    Powerful live scanner & backtester for ORB strategies on 595+ stocks.

    Explore ORB Setups →
My Account
Back to Tutorials
Beginner 13 minutes ThinkOrSwim

TTM Squeeze Scanner

Build a TTM Squeeze scanner to find 5 consecutive dots in a row with stacked moving averages. Free ThinkOrSwim code and step-by-step tutorial for explosive breakout setups.

Download Scan
How to install in ThinkOrSwim →
Table of Contents
  • The Complete Guide to TTM Squeeze Scanner – Find 5 Dots in a Row with ThinkOrSwim
  • Understanding TTM Squeeze Mechanics and Multiple Squeeze Dots
  • Accessing TTM Squeeze Plot Variables for Custom Scanning
  • Building the Core TTM Squeeze Scanner Logic for 5 Dots in a Row
  • Implementing Stacked Moving Average Trend Filters
  • Advanced Pattern Recognition and Filtering
  • Practical TTM Squeeze Scanner Implementation and Setup
  • Bullish vs Bearish Scan Variations
  • Case Study Analysis: Practical Application Examples
  • Optimization Strategies and Parameter Adjustment
  • Integration with Trading Strategy and Risk Management
  • Market Environment Considerations and Timing
  • Advanced Applications and Triple Squeeze Integration
  • Common Implementation Mistakes and Solutions

Master TTM Squeeze Scanner for 5 Dots in a Row

Discover how to build powerful TTM Squeeze scanners that automatically identify stocks with 5 consecutive red squeeze dots combined with stacked moving averages – the perfect setup for explosive breakout moves.

This comprehensive TTM Squeeze scanner tutorial teaches you to create custom ThinkScript scanners that find:

  • 5 consecutive TTM Squeeze dots (red compression dots)
  • Multiple squeeze dots with bullish stacked moving averages (8, 21, 34 EMAs + 50, 200 SMAs)
  • Bearish stacked moving averages for short opportunities
  • High-probability squeeze compression setups ready for momentum moves

Perfect for swing traders and momentum traders looking to catch explosive moves as squeeze compression leads to expansion phases.

The Complete Guide to TTM Squeeze Scanner – Find 5 Dots in a Row with ThinkOrSwim

The TTM Squeeze scanner is one of the most powerful tools for identifying periods of low volatility that precede explosive price movements. When multiple squeeze dots appear consecutively, it creates coiled spring scenarios where price action becomes primed for significant directional moves. The key is building a TTM Squeeze scanner that finds when this compression has built sufficient energy for meaningful breakouts.

This systematic TTM Squeeze scanner approach focuses on finding stocks with 5 consecutive squeeze dots – specifically sustained compression periods – combined with trending market structure. When these consecutive squeeze dots align with directional bias from stacked moving averages, they create some of the highest probability setups available to technical traders.

Understanding TTM Squeeze Mechanics and Multiple Squeeze Dots

The TTM Squeeze scanner compares Bollinger Bands to Keltner Channels to determine periods of volatility compression. When Bollinger Bands contract inside Keltner Channels, volatility has compressed to levels that historically precede significant moves. The TTM Squeeze scanner displays this compression through colored dots on the price chart.

Red squeeze dots indicate active compression where volatility has contracted below normal levels. The longer this compression persists with multiple squeeze dots, the more energy builds for the eventual expansion phase. Five consecutive red dots represent substantial compression that often leads to powerful breakout moves when the squeeze finally releases.

Green dots indicate the absence of a squeeze, showing periods when volatility has expanded beyond the compression threshold. The transition from multiple squeeze dots (red) to green dots often marks the beginning of significant price movements as compressed energy releases into trending action.

Understanding this cycle of squeeze compression and expansion allows traders to position themselves before major moves rather than chasing momentum after breakouts become obvious to the broader market.

Accessing TTM Squeeze Plot Variables for Custom Scanning

ThinkOrSwim’s built-in TTM Squeeze indicator contains multiple plot variables that can be accessed programmatically for custom scanning applications. The most important variable for compression detection is the “SqueezeAlert” plot, which provides binary output indicating squeeze presence or absence.

The SqueezeAlert variable outputs a value of 0 when a squeeze is active (red dot) and a value of 1 when no squeeze is present (green dot). This binary nature makes it perfect for mathematical operations that can identify consecutive squeeze periods programmatically.

By examining the SqueezeAlert values over multiple time periods, we can create conditions that identify exactly the patterns we want to trade. The key insight is that five consecutive zeros in the SqueezeAlert output corresponds to five consecutive red squeeze dots on the chart.

This approach allows us to systematically scan for squeeze patterns without manually reviewing charts, creating a scalable method for opportunity identification across large universes of stocks.

Building the Core TTM Squeeze Scanner Logic for 5 Dots in a Row

The foundation of our TTM Squeeze scanner relies on the SUM function to evaluate SqueezeAlert values over specified time periods. When we sum the SqueezeAlert values over five periods and get a result of zero, we know all five periods contained red squeeze dots – exactly what our TTM Squeeze scanner needs to identify.

Here’s the core ThinkScript implementation for the TTM Squeeze scanner:

# Define the condition for 5 consecutive squeeze dots
def fiveDotsInARow = if Sum(TTMSqueeze().SqueezeAlert, 5) == 0 then 1 else 0;

This TTM Squeeze scanner logic creates a binary condition that evaluates to 1 when the sum of SqueezeAlert values over the past 5 bars equals zero. Since SqueezeAlert outputs 0 for red dots and 1 for green dots, a sum of zero means all five periods contained consecutive squeeze dots.

The SUM function provides an elegant solution for the TTM Squeeze scanner to count consecutive occurrences without requiring complex conditional logic or loops. This approach scales easily to different time periods by simply adjusting the second parameter of the SUM function.

For traders wanting longer compression periods in their TTM Squeeze scanner, changing the 5 to 7 or 10 will identify stocks with even more sustained squeeze conditions. Conversely, reducing to 3 or 4 will capture shorter compression periods but may include more false signals.

Implementing Stacked Moving Average Trend Filters

Combining squeeze detection with trend analysis significantly improves setup quality by ensuring directional bias aligns with compression release potential. Stacked moving averages provide clear trend definition and help filter squeeze setups for directional probability.

The moving average stack includes both exponential and simple moving averages to capture different aspects of trend behavior. Exponential moving averages (8, 21, 34) respond quickly to price changes and identify short-term momentum, while simple moving averages (50, 200) provide longer-term trend context.

For bullish setups, we require the following stacking order:

# Define bullish stacked moving averages
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);

def bullStacked = ema8 > ema21 and ema21 > ema34 and sma50 > sma200;

This configuration ensures that shorter-term averages sit above longer-term averages, indicating sustained upward momentum across multiple time horizons. When squeeze release occurs in this environment, upward breakouts become more probable.

Bearish configurations reverse this logic, requiring shorter-term averages below longer-term averages to indicate downward trending environments where squeeze releases more likely produce downward breakouts.

Advanced Pattern Recognition and Filtering

While five consecutive squeeze dots create the foundation for our scanning logic, additional pattern recognition can further refine setup quality. Consider the position of current price relative to the moving average stack and the duration of the current squeeze cycle.

Price position relative to moving averages provides additional confirmation of directional bias. Bullish setups become more compelling when price trades above the moving average stack, while bearish setups gain strength when price sits below the stack.

Squeeze duration analysis can identify setups with unusual compression periods. Stocks that have maintained squeeze conditions for significantly longer than average often produce more explosive breakouts when compression finally releases.

Volume characteristics during squeeze periods can also provide valuable insights. Decreasing volume during compression followed by expanding volume as squeeze conditions end often indicates genuine accumulation or distribution processes.

Practical TTM Squeeze Scanner Implementation and Setup

Setting up the TTM Squeeze scanner requires accessing ThinkOrSwim’s custom study filters through the Stock Hacker tool. This TTM Squeeze scanner functionality is only available in live trading accounts, as paper trading accounts don’t support custom ThinkScript filters.

Navigate to the Scan tab and add a new Study filter. Select Custom from the dropdown menu and access the ThinkScript Editor to input your custom TTM Squeeze scanner code. Set the timeframe to Daily for swing trading applications or adjust to shorter timeframes for day trading approaches.

The complete TTM Squeeze scanner combines both squeeze detection and moving average filters into a single condition:

# Complete bullish TTM Squeeze scanner for 5 dots in a row
def fiveDotsInARow = if Sum(TTMSqueeze().SqueezeAlert, 5) == 0 then 1 else 0;
def bullStacked = ema8 > ema21 and ema21 > ema34 and sma50 > sma200;

plot signal = if fiveDotsInARow and bullStacked then 1 else 0;

This TTM Squeeze scanner configuration will identify stocks meeting both criteria simultaneously, providing a focused list of high-probability squeeze breakout candidates with multiple squeeze dots.

Bullish vs Bearish Scan Variations

Creating both bullish and bearish versions of the squeeze scanner provides opportunities in different market environments. Bullish scans identify compression setups in uptrending environments, while bearish scans find similar patterns in downtrending contexts.

The only difference between bullish and bearish implementations lies in the moving average stacking requirements. Bearish scans reverse the inequality operators to identify downward trending environments:

# Bearish stacked moving averages
def bearStacked = ema8 < ema21 and ema21 < ema34 and sma50 < sma200;

Running both scan types provides a comprehensive view of squeeze opportunities across different market conditions. During strong bull markets, focus on bullish squeeze setups. During bear markets or correction phases, bearish squeeze scans become more relevant.

Consider market environment when interpreting scan results. Individual stock setups should align with broader market direction for optimal probability. Contrarian setups can work but require more careful analysis and risk management.

Case Study Analysis: Practical Application Examples

Real-world application of these scanners demonstrates their effectiveness across different market conditions and stock characteristics. Examining specific examples helps illustrate the pattern recognition process and setup evaluation criteria.

Costco (COST) exemplified the ideal bullish squeeze setup during our analysis period. The stock showed clear stacked moving averages in bullish configuration with five consecutive red squeeze dots, creating textbook conditions for upward breakout potential.

The technical setup showed price consolidating just above the 8 EMA while maintaining the required moving average stack. Volume characteristics supported the pattern, with decreasing volume during compression followed by expansion as squeeze conditions began resolving.

AutoZone (AZO) provided another excellent example of bullish squeeze patterns, demonstrating how the scanner identifies stocks across different sectors and price ranges. The consistency of pattern identification across diverse stocks validates the scanning methodology.

Bearish examples like Qualcomm (QCOM) and eBay (EBAY) showed how the same squeeze compression principles apply in downtrending environments. These stocks exhibited five consecutive squeeze dots while maintaining bearish moving average configurations, creating high-probability short opportunities.

Optimization Strategies and Parameter Adjustment

Fine-tuning scanner parameters based on market conditions and personal trading style improves results over time. The number of consecutive squeeze dots, moving average periods, and additional filters can all be adjusted for optimization.

Experimenting with different squeeze dot requirements allows customization for varying patience levels and setup frequency preferences. Requiring 7 or 10 consecutive dots creates fewer but potentially higher-quality signals, while reducing to 3 or 4 dots increases opportunity frequency.

Moving average period adjustments can align the scanner with different trading timeframes. Shorter periods create more responsive trend identification for day trading applications, while longer periods provide stability for swing trading approaches.

Additional volume filters can improve setup quality by ensuring adequate liquidity for position entry and exit. Minimum volume requirements eliminate thinly traded stocks that may not produce reliable breakout behavior.

Integration with Trading Strategy and Risk Management

Squeeze scanners work best as part of comprehensive trading strategies rather than standalone signal generators. Combine scanner results with additional technical analysis, fundamental considerations, and market environment assessment for optimal results.

Entry timing becomes critical with squeeze setups since the exact breakout moment remains uncertain. Consider entering positions as squeeze conditions begin resolving rather than waiting for complete breakouts, as early entry often provides better risk-reward ratios.

Stop-loss placement should account for the volatility expansion that accompanies squeeze releases. Traditional tight stops may get hit by normal breakout volatility, while wider stops better accommodate the expected price movement characteristics.

Position sizing should reflect the binary nature of squeeze breakouts. These setups often produce significant moves or fail completely, making consistent position sizing important for long-term success.

Market Environment Considerations and Timing

Squeeze scanner effectiveness varies with overall market conditions, making environmental awareness crucial for optimal application. Bull markets typically favor bullish squeeze breakouts, while bear markets create better conditions for bearish setups.

During high volatility periods, squeeze conditions may resolve quickly without producing sustained moves. Conversely, during extremely low volatility environments, squeeze releases often generate more significant and lasting price movements.

Sector rotation patterns influence squeeze breakout success rates. Stocks in favored sectors tend to see stronger follow-through on squeeze releases, while those in out-of-favor sectors may struggle despite technically sound patterns.

Economic calendar events and earnings announcements can accelerate squeeze releases or create false breakouts. Consider these catalysts when evaluating squeeze timing and potential trade duration.

Advanced Applications and Triple Squeeze Integration

For advanced practitioners, the concepts demonstrated in this basic squeeze scanner can be extended to more sophisticated indicators like the Triple Squeeze, which monitors multiple timeframe compression simultaneously.

Triple Squeeze scanners would require identifying combinations of red, black, and yellow dots representing different compression levels. The logic remains similar but requires additional conditions to account for multiple squeeze types occurring simultaneously.

Multi-timeframe squeeze analysis can identify even higher probability setups where compression exists across daily, weekly, and monthly timeframes simultaneously. These confluent patterns often produce the most explosive breakout moves.

Advanced pattern recognition might include squeeze histogram analysis, momentum acceleration patterns, and volume confirmation studies to further refine setup identification and timing precision.

Common Implementation Mistakes and Solutions

Several common errors can reduce scanner effectiveness and should be avoided during implementation. Understanding these pitfalls helps ensure optimal scanner performance and reliable results.

Overoptimization of parameters based on recent market performance can reduce future effectiveness. Maintain reasonable parameter settings that work across different market environments rather than optimizing for specific periods.

Ignoring market environment while focusing solely on individual setups often leads to disappointing results. Always consider broader market conditions when evaluating squeeze scanner results.

Inadequate risk management specific to squeeze characteristics can result in poor trade outcomes despite good setup identification. Adjust position sizing and stop placement for squeeze-specific volatility patterns.

Expecting immediate results from squeeze patterns can lead to premature position exits. Squeeze releases often require several days or weeks to fully develop, requiring patience during the expansion phase.

The systematic approach to squeeze scanning creates a powerful framework for identifying high-probability breakout opportunities. Focus on quality setup identification, proper risk management, and patience during pattern development for optimal long-term results.

TTM Squeeze Scanner.ts
# TTM Squeeze Scanner – Find 5 Dots in a Row for ThinkOrSwim

# Generated by TOS Indicators

# Define condition for 5 consecutive squeeze dots

def fiveDotsInARow = if Sum(TTMSqueeze().SqueezeAlert, 5) == 0 then 1 else 0;

# Define moving averages for trend analysis


// ... 28 more lines ...

Unlock This Code

Create a free account to access the full source code and download files.

Create Free Account Login
Use the SUM function with TTM Squeeze SqueezeAlert variable: def fiveDotsInARow = if Sum(TTMSqueeze().SqueezeAlert, 5) == 0 then 1 else 0; This TTM Squeeze scanner checks if the sum of SqueezeAlert values over 5 bars equals zero, indicating 5 consecutive red squeeze dots.
Red squeeze dots indicate active volatility compression (squeeze) where Bollinger Bands contract inside Keltner Channels. Green dots show no squeeze conditions with normal or expanded volatility. The TTM Squeeze scanner uses SqueezeAlert variable which outputs 0 for red dots and 1 for green dots, making it perfect for scanning consecutive squeeze periods.
Define your moving averages and create stacking conditions: def bullStacked = ema8 > ema21 and ema21 > ema34 and sma50 > sma200; Then combine with your TTM Squeeze scanner condition: plot signal = if fiveDotsInARow and bullStacked then 1 else 0; This ensures both squeeze compression and trend alignment.
Yes, adjust the second parameter in the SUM function. For 3 consecutive dots use Sum(TTMSqueeze().SqueezeAlert, 3) == 0, for 7 dots use Sum(TTMSqueeze().SqueezeAlert, 7) == 0. Longer sequences in your TTM Squeeze scanner create fewer but potentially higher-quality signals.
ThinkOrSwim's custom study filters and ThinkScript editor are only available in live trading accounts. Paper trading accounts don't support custom scanning functionality. You must use the live platform to create and run custom TTM Squeeze scanners for multiple squeeze dots.
Use the same TTM Squeeze scanner logic but change the moving average stacking condition. Bullish: ema8 > ema21 and ema21 > ema34 and sma50 > sma200. Bearish: ema8 < ema21 and ema21 < ema34 and sma50 < sma200. This identifies squeeze compression setups in different trend environments.
Daily timeframe works well for swing trading TTM Squeeze scanner breakouts with multiple squeeze dots. Shorter timeframes (hourly, 4-hour) work for day trading but may produce more false signals. Weekly timeframes identify longer-term compression but fewer opportunities. Daily provides good balance of reliability and frequency.
Squeeze releases can't be timed precisely even with a TTM Squeeze scanner. Some resolve within days while others persist for weeks. Monitor for the first green dot (SqueezeAlert = 1) which signals squeeze release. Consider entering positions as compression begins resolving rather than waiting for complete breakouts for better risk-reward ratios.

Here are some resources that you may find useful:

  • Complete Squeeze Course (15+ Proprietary Squeeze Tools)
  • How to import an indicator into ThinkOrSwim (video tutorial)
Featured Tools:
Stock Volatility Box

Stock Volatility Box

Spot reversal zones across 600 stocks & ETFs.

  • Hourly & daily models
  • Powerful Live Scanner
  • Built for day traders
Futures Volatility Box

Futures Volatility Box

Pinpoint reversal zones in 10 major futures markets.

  • 5 models (incl. Scalper)
  • ThinkOrSwim & TradingView
  • SPX traders
ORB Setups

ORB Setups

Find the best Opening Range Breakout setups.

  • Powerful real-time scanner
  • Instant backtests
  • 2+ years data

Get Free Access

Create a free account for downloads and new tutorial alerts.

Create Free Account

More Tutorials Like This

DMI Power Move Scans

DMI Power Move Scans

Beginner • 24 minutes
Rate of Change Scans

Rate of Change Scans

Beginner • 7 minutes
Stacked Moving Averages

Stacked Moving Averages

Beginner • 8 minutes

Ready to Trade With an Edge?

Join 40,000+ traders using institutional-grade tools for ThinkOrSwim.

Get the Bundle
TOS Indicators

Premium thinkorswim indicators, scans, and trading tools to help you trade smarter.

ThinkOrSwim Tools

  • Indicators
  • Scans
  • Backtesters
  • Dashboards
  • thinkScript
  • Browse All

Courses

  • Squeeze Course
  • Earnings Course
  • V-Shaped Reversals
  • Fibonacci Trading

Products

  • Futures Volatility Box
  • Stock Volatility Box
  • ORB Setups
  • Shop All

Guides

  • TTM Squeeze
  • Automated Trading
  • Volatility Trading
  • Opening Range Breakouts
  • Trade Reports
  • Contact Us

© 2026 TOS Indicators. All rights reserved.

Privacy Policy Terms of Service Disclaimer

The information contained on this website is solely for educational purposes, and does not constitute investment advice. The risk of trading in securities markets can be substantial. You must review and agree to our Terms of Service prior to using this site.

U.S. Government Required Disclaimer - Commodity Futures Trading Commission. Futures and options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This website is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this website. The past performance of any trading system or methodology is not necessarily indicative of future results.

Individual results may vary, and testimonials are not claimed to represent typical results. All testimonials are by real people, and may not reflect the typical purchaser's experience, and are not intended to represent or guarantee that anyone will achieve the same or similar results.

TOS Indicator's Traders and employees will NEVER manage or offer to manage a customer or individual's options, stocks, currencies, futures, or any financial markets or securities account. If someone claiming to represent or be associated with TOS Indicator solicits you for money or offers to manage your trading account, do not provide any personal information and contact us immediately.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.