# Average True Range Scanner

> Free ATR (Average True Range) scanner for ThinkOrSwim. Find high-volatility breakout candidates and low-volatility compression setups.

Page: https://tosindicators.com/scans/average-true-range  
Video: https://www.youtube.com/watch?v=Z7HcNs6g5Io  
Section: Scans  
Skill: Beginner  
Access: free  
Updated: 2026-02-12

## Master ATR-Based Stock Scanning in ThinkOrSwim


Discover how to build sophisticated Average True Range scanners that automatically identify high-probability trading setups based on volatility patterns and price compression.


In this detailed tutorial, you'll learn to create 2 essential ATR scanners:




- High ATR Scanner - Identifies stocks with above-average volatility

- ATR Compression Scanner - Finds stocks compressing near key moving averages


These scanners help you spot stocks primed for significant moves by analyzing volatility patterns that often precede major price breakouts and momentum shifts.

## Building Average True Range Scanners in ThinkOrSwim



Average True Range (ATR) scanners provide a systematic approach to identifying stocks with specific volatility characteristics that often precede significant price movements. By focusing on volatility patterns rather than just price action, you can spot high-probability trading opportunities before they become obvious to other traders.



ATR, developed by J. Welles Wilder Jr., measures market volatility by calculating the average range between high and low prices over a specified period. Unlike directional indicators, ATR focuses purely on the magnitude of price movement, making it valuable for both opportunity identification and risk management.




## High ATR Scanner Implementation



The first scanner identifies stocks where current ATR exceeds the 50-day moving average of ATR values. This approach filters for stocks experiencing above-normal volatility, which often correlates with emerging institutional activity and breakout potential.




```
def ATR = ATR();
def averageATR = Average(ATR, 50);
plot signal = ATR > averageATR;
```



This scanner identifies stocks experiencing increased institutional activity, breakout candidates with expanding volatility, and opportunities for momentum-based strategies. The logic is straightforward: when current volatility exceeds the recent average, it often signals that something significant is happening with the stock.



For optimal implementation, run this scan during market hours for real-time alerts. Add basic liquidity filters in Stock Hacker: minimum stock price above $10 and average volume above 2 million shares. This ensures you're working with liquid stocks that won't gap against you unexpectedly.



The 50-day average provides a good balance between responsiveness and stability. Shorter periods (20-30 days) will give more signals but may include more false positives. Longer periods (100+ days) will be more selective but may miss shorter-term opportunities.




## ATR Compression Scanner Development



The compression scanner is more sophisticated, designed to identify stocks in tight trading ranges near key moving averages. This pattern often precedes significant breakouts as volatility contracts before expanding in major moves.



The scanner combines three key technical components that work together to identify high-probability compression patterns:



**Range Compression Analysis:** Calculate the 10-day high-low range and compare it to current ATR values. When the recent range is tight relative to normal volatility, it suggests accumulation or distribution activity:




```
def highestHigh = Highest(high, 10);
def lowestLow = Lowest(low, 10);
def range = highestHigh - lowestLow;
def rangeCompression = range
```



The multiplier of 2 works well for most stocks, but you can adjust based on market conditions. During high volatility periods, increase to 2.5 or 3. During quiet markets, reduce to 1.5 to capture more opportunities.



**Moving Average Structure:** The scanner requires specific moving average alignment to confirm trend structure. This ensures you're finding compression patterns within established trends rather than directionless consolidation:




```
def EMA8 = ExpAverage(close, 8);
def EMA34 = ExpAverage(close, 34);
def SMA50 = SimpleMovingAvg(close, 50);
def SMA200 = SimpleMovingAvg(close, 200);
def movingAverageCondition = EMA8 > EMA34 and EMA34 > SMA50 and SMA50 > SMA200;
```



This moving average hierarchy ensures you're only finding compression patterns in stocks with bullish structure. For bearish setups, reverse the conditions. You can also remove the SMA200 condition if you want a larger universe of stocks.



**Proximity to Key Levels:** The final component ensures price is trading within a specified percentage of the 50-day simple moving average:




```
input pct = 0.03;
def pctWithinSMA = close >= (SMA50 * (1 - pct)) and close
```



The 3% range works well for most stocks, but you can adjust based on your preferences. Tighter ranges (1-2%) will find stocks very close to the moving average, while wider ranges (4-5%) will capture more opportunities but may be less precise.




## Timeframe and Market Condition Optimization



These scanners adapt well to different timeframes and market conditions with proper parameter adjustments.



**Timeframe Adaptation:** For day trading, apply the scanners to 5-15 minute charts and reduce the ATR period to 10 bars. For swing trading, daily charts work best with the standard 14-period ATR. For position trading, consider weekly charts with 20-period ATR.



**Market Condition Adjustments:** During high volatility markets (VIX above 25), increase the ATR multiplier in the compression scanner to 2.5 or 3 to avoid false signals. In quiet markets (VIX below 15), reduce the multiplier to 1.5 to capture more opportunities.



**Sector Considerations:** Technology stocks often require higher ATR thresholds due to their inherent volatility. Utilities and consumer staples may trigger signals with lower multipliers. Consider creating sector-specific scanner versions.




## Implementation Strategy and Alert Setup



Effective ATR scanning requires a systematic approach to maximize opportunities while minimizing false signals.



**Alert Configuration:** Set up real-time alerts by saving your scans in Stock Hacker and enabling "Alert when scan results change." Configure both sound and mobile notifications through the ThinkOrSwim mobile app. This ensures immediate notification when new opportunities emerge during market hours.



**Scan Execution Timing:** Run the high ATR scanner during market hours for immediate momentum opportunities. Execute the compression scanner after market close to prepare your watchlist for the following day. This approach lets you research potential setups when markets are closed.



**Result Filtering:** Always verify scanner results with additional analysis. Check for recent news, earnings announcements, and overall chart structure. Volume confirmation is crucial - look for above-average volume to validate the scanner signals.




## Risk Management and Position Sizing



ATR values from your scans provide excellent guidance for risk management decisions.



**Stop Loss Placement:** Use ATR values to set initial stop losses. A common approach is placing stops at 1.5-2x the current ATR below your entry price for long positions. This accounts for normal volatility while providing meaningful protection.



**Position Sizing:** Higher ATR stocks require smaller position sizes to maintain consistent risk levels. Consider using the formula: Position Size = Risk Amount / (ATR × Stop Loss Multiplier). This automatically adjusts your position size based on the stock's volatility.



**Profit Targets:** Set initial profit targets at 2-3x the ATR from your entry point. This provides realistic expectations based on the stock's normal movement patterns.




## Advanced Filtering and Integration



**Volume Confirmation:** Add volume filters to ensure adequate liquidity. Minimum average volume of 1-2 million shares helps avoid thin stocks that might gap unexpectedly. Also look for above-average volume on the day stocks appear on your scanner.



**Earnings Calendar Integration:** Be aware of upcoming earnings announcements, as these can cause volatility spikes unrelated to technical patterns. Consider excluding stocks with earnings within 3-5 days, or create separate scans specifically for earnings plays.



**Integration with Other Indicators:** Combine ATR scanners with momentum indicators like RSI or MACD for timing entries. Use volume analysis to confirm signals, and check support/resistance levels from the scanner results.




## Performance Tracking and Continuous Improvement



Track your scanner performance to optimize parameters and improve results over time.



**Hit Rate Analysis:** Monitor how often scanner results lead to profitable trades. Track this data by scanner type, market condition, and timeframe to identify the most effective applications.



**Parameter Testing:** Test different ATR multipliers, timeframes, and additional filters. Keep detailed records of parameter changes and their impact on results. What works in trending markets may not work in range-bound conditions.



**False Signal Reduction:** Identify common characteristics of false signals and add filters to reduce them. This might include minimum volume requirements, price action confirmations, or additional technical indicators.



Successful ATR scanning requires patience and discipline. These scanners identify potential opportunities, not guaranteed profits. Always combine scanner results with proper risk management, market context analysis, and confirmation techniques. Start with the basic high ATR scanner to understand volatility-based opportunity identification, then gradually incorporate the more sophisticated compression scanner as you gain experience.

## thinkScript code

```
# Average True Range Scanners for ThinkOrSwim
# Generated by TOS Indicators
# Full tutorial: tosindicators.com/scans/average-true-range

# Scanner 1: High ATR Detection
# Identifies stocks with ATR above 50-day average
def ATR = ATR();
def averageATR = Average(ATR, 50);
plot signal = ATR > averageATR;

# Scanner 2: ATR Compression Pattern Detection
# Finds stocks compressing near moving averages

# Inputs
input pct = 0.03;

# ATR Calculation
def ATRValue = ATR();

# Compressed Range Analysis
def highestHigh = Highest(high, 10);
def lowestLow = Lowest(low, 10);
def range = highestHigh - lowestLow;
def rangeCompression = range  EMA34 and EMA34 > SMA50 and SMA50 > SMA200;

# Proximity to 50 SMA
def pctWithinSMA = close >= (SMA50 * (1 - pct)) and close  $10
# Average Volume > 2,000,000 shares
```

## Questions

### How do I scan for stocks with ATR values between specific ranges in ThinkOrSwim?

To scan for stocks with ATR between specific values (e.g., 0.50 to 2.00), use: def atrValue = ATR(); plot signal = atrValue >= 0.50 and atrValue

### Why doesn't my ATR scan work on custom timeframes in ThinkOrSwim?

ThinkOrSwim scanners only work on the timeframe you select in the scan aggregation period - they don't support custom-timeframe scanning. You are limited to running the scan on the built-in aggregation periods that ThinkOrSwim provides (ie. you cannot run a custom 39-minute ATR scan).

### How do I scan for stocks with high ATR values above a specific dollar amount?

Use this code to find stocks with ATR above a specific value: def atrValue = ATR(); plot signal = atrValue >= 1.0; Replace 1.0 with your minimum ATR requirement. Many traders prefer stocks with at least $0.50 ATR for day trading or $1.00+ ATR for swing trading to ensure adequate movement potential.

### Why is my ATR scan returning no results or throwing errors?

Common issues include: missing plot statement (always include "plot signal = condition;"), incorrect syntax, or too restrictive filters. Start with basic liquidity filters (price > $10, volume > 1M) and a simple ATR condition. If still getting errors, check for typos and ensure you're using ThinkScript Editor, not Condition Wizard for custom ATR code.

### How do I create an ATR scan that works in pre-market hours?

Pre-market ATR scanning is challenging because there's limited data and gaps in price action. Use extended hours data and consider using the previous day's ATR for filtering: def atrValue = ATR(); plot signal = atrValue > Average(ATR(), 20); This compares current ATR to the 20-day average, which works better with sparse pre-market data.

### What's the difference between using ATR() and TrueRange() in scans?

ATR() gives you the smoothed average true range over a period (default 14), while TrueRange() gives the raw true range for individual bars. For scanning, use ATR() for general volatility filtering: plot signal = ATR() > 1.0; Use TrueRange() for specific bar patterns: plot signal = TrueRange(high, close, low) > ATR() * 2.0;

### How do I scan for stocks where today's range exceeds the ATR?

Use this code to find stocks with today's range greater than ATR: def todayRange = high - low; def atrValue = ATR(); plot signal = todayRange > atrValue; This identifies stocks experiencing above-average daily movement, useful for finding momentum plays or breakout candidates.

### Can I use the built-in ATRHighSMABreakoutsFilter instead of custom code?

Yes, ThinkOrSwim includes [ATRHighSMABreakoutsFilter](https://toslc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/A-B/ATRHighSMABreakoutsFilter) in Stock Hacker under Study filters. It's designed for stocks priced $15-$70 with minimum $5 range over 90 days and 1M+ volume. However, custom ATR scans offer more flexibility and can be used on any timeframe, while the built-in filter only works on daily charts.

## Related

- [How to Scan for False Breakouts in ThinkOrSwim](https://tosindicators.com/scans/false-breakout-scanner)
- [Monthly Watchlist Scan](https://tosindicators.com/scans/monthly-watchlist)
- [TTM Squeeze Scanner](https://tosindicators.com/scans/ttm-squeeze-dots)
- [Stacked Moving Averages](https://tosindicators.com/scans/stacked-ma)
- [Upcoming Earnings Scan](https://tosindicators.com/scans/upcoming-earnings)
- [Rate of Change Scans](https://tosindicators.com/scans/roc)

