LogoLogo
Return to StockChartsCharts & ToolsArticlesChartSchoolYour Dashboard
  • Support Center
  • Finding Your Way Around
    • Intro to StockCharts
    • Navigating the Website
    • Logging In for the First Time
    • Members Dashboard
  • data and ticker symbols
    • Data Availability
      • Markets We Cover
      • Real-Time Data
        • BATS Real-Time Data
      • Extended Hours Data
      • Data Bar Periods
      • Price Data Adjustments
      • Historical Data
        • How Do I Download Data to Excel?
        • StockCharts Historical Sector Data
    • Ticker Symbols
      • Ticker Symbol Conventions
      • How to Find a Ticker Symbol
      • Using the Index Catalog
      • Ratio and Difference Symbols
      • Pseudo-Symbols
      • User-Defined Indexes
  • Charts & Tools
    • SharpCharts
      • SharpCharts Workbench
        • Creating and Viewing SharpCharts
        • Printing and Sharing SharpCharts
        • Editing SharpCharts
          • Using the SharpCharts Interactive Date Slider
          • Charting Market Breadth Indicators
          • SharpCharts Parameter Reference
        • Saving SharpCharts
        • Additional SharpCharts Workbench Tools
          • Viewing ChartLists on the SharpCharts Workbench
          • Viewing Alerts on the SharpCharts Workbench
          • Viewing Options Data on the SharpCharts Workbench
      • ChartStyles & StyleButtons
        • Working with ChartStyles and StyleButtons
        • Using the ChartStyle Library
        • Tool-Specific ChartStyles
      • ChartNotes
        • Annotating SharpCharts with ChartNotes
        • ChartNotes Annotation Tool Reference
          • Line Tools
          • Text Annotation Tools
          • Shape Tools
          • Line Study Tools
      • ChartLists
        • Summary View
        • ChartList View
        • ChartBook View
        • Performance View
        • Correlation View
        • Edit View
        • ChartList Reports
        • ChartPacks
      • Classic SharpCharts Workbench
      • StockCharts Mobile App
    • StockChartsACP
      • Creating ACP Charts
      • Multi-Chart Layouts in StockChartsACP
      • Viewing ACP Charts
      • Printing and Sharing ACP Charts
      • Editing ACP Charts
      • Applying Chart Templates to ACP Charts
      • Annotating ACP Charts
        • StockChartsACP Line Tools
        • StockChartsACP Text Annotation Tools
        • StockChartACP Shape Tools
        • StockChartsACP Line Study Tools
      • Working with Saved ACP Charts
      • StockChartsACP Plug-Ins
        • Chaikin Power Gauge Plug-In
        • GoNoGo Charts Plug-In
        • Larry Williams Stock Trading Starter Pack Plug-In
        • MarketGauge Plug-Ins
        • Simpler Trading Moxie Indicator Plug-In
        • Trading Simplified by Dave Landry
        • Trend Investor Pro Indicator Edge
    • Other Charting Tools
      • P&F Charts
      • GalleryView
      • Seasonality Charts
      • CandleGlance Charts
      • MarketCarpets
      • Interactive PerfCharts
      • RRG Charts
      • Dynamic Yield Curve
    • Research Tools
      • Symbol Summary
      • Options Summary
        • OptionsPlay Explorer
      • OptionsPlay Strategy Center
      • Market Summary
      • Sector Summary
      • Industry Summary
      • Index Members
      • StockCharts Technical Rank (SCTR) Reports
      • Earnings Calendar
      • Cryptocurrency Summary
    • Reports and Galleries
      • The Ticker Cloud
      • Historical Chart Gallery
      • Predefined Scan Results
        • Customizing Predefined Scans
      • Predefined Technical Alerts
      • DecisionPoint Chart Gallery
      • Public ChartLists
        • Becoming a Public ChartList Author
      • SharpCharts Voyeur
  • Scanning & Alerts
    • Technical Scans
      • Scanning for Stocks: The Basics
      • Advanced Scan Workbench
      • Standard Scan Workbench
      • Working With Scan Results
    • Scan Writing Resource Center
      • Planning Scans
      • Writing Scans
      • Scanning Tutorials
        • Scan Workbench Tutorial
        • Scan Results Tutorial 1
        • Scan Results Tutorial 2
        • Writing Scans Tutorial 1
        • Writing Scans Tutorial 2
        • Creating Scan Templates Tutorial
        • Troubleshooting Scans Tutorial 1
        • Troubleshooting Scans Tutorial 2
        • Troubleshooting Scans Tutorial 3
      • Scanning Case Studies
        • Scanning for Crossovers
        • Scanning for "Near Crosses"
        • Scanning for Divergences
        • Scanning for Relative Strength
        • Scanning for Consolidation and Breakouts
        • Scanning for Selling Climaxes
        • Scanning for SCTRs
        • Scanning Ichimoku Clouds
        • Scanning for P&F Chart Patterns
        • Scanning Your ChartLists
        • Scanning for an Overlay of an Indicator
        • Writing Min/Max Scans
        • Writing Percent Change Scans
        • Scanning Over a Range of Dates
        • Writing Scans With OR Clauses
      • Troubleshooting Scans
        • Troubleshooting Equality Scans
      • Getting Help With Scans
      • Scan Syntax Reference
        • Scan Syntax: Ticker Properties
        • Scan Syntax: Price, Volume, and SCTRs
        • Scan Syntax: Technical Indicators
        • Scan Syntax: Technical Functions
        • Scan Syntax: Predefined Patterns
        • Scan Syntax: Groups
      • Advanced Scan Library
        • Sample Scans
        • Predefined Scans
        • Published Scans
        • User-Contributed Scans
        • Gord Greer's Scan Building Blocks
    • Technical Alerts
      • Technical Alert Workbench
      • Your Alerts
  • Your Account
    • Subscribing to StockCharts
    • Service Levels & Data Plans
    • Login & Passwords
    • Your Account Settings
    • Managing Your Subscription
      • Cancelling Your Account
    • StockCharts Add-Ons
      • OptionsPlay Add-On
  • Learning More
    • Market Commentary
      • Blogs
      • ChartWatchers Newsletter
      • StockCharts TV
    • Educational Resources
    • Frequently Asked Questions (FAQs)
    • Step-By-Step Instructions
      • SharpCharts How-Tos
        • SharpCharts Workbench How-Tos
          • How to Print a SharpChart
          • How to Share a SharpChart on Social Media
          • How to Email a SharpChart
          • How to Insert a SharpChart in a Document or Presentation
          • How to View Indicator and Overlay Values for Specific Days
          • How to Save a SharpChart
        • SharpChart Editing How-Tos
          • How To Use The Interactive Date Slider
          • How to Display More than One Symbol on a SharpChart
          • How to Create Overlaid Charts
          • How to Add an Overlay to an Indicator
          • How to Add a Moving Average to the Volume Bars on a Chart
        • ChartNotes How-Tos
          • How to Pin an Annotation on a SharpChart
          • How to Save a Chart from a Blog Article with the Author's Annotations
        • ChartList How-Tos
          • How to Use the ChartList Summary
          • How to Search for a Saved Chart in Your ChartLists
          • How to Share a ChartList with Another Member
        • ChartList Editing How-Tos
          • How to Create a New ChartList
          • How to Add Predefined Symbol Groups to a New ChartList
          • How to Add Predefined Groups into an Existing ChartList
          • How to Upload Symbols to a ChartList from a Spreadsheet
          • How to Rearrange Charts in a ChartList
          • How to Delete a Saved Chart from a ChartList
      • StockChartsACP How-Tos
        • Setting Period, Type And, Range
        • Chart Attributes
          • Part One
          • Part Two
        • Sharing And Printing
        • Saving Charts
          • Saving A New Chart
          • Saving An Existing Chart As New
        • Chart Templates
          • Applying Predefined Chart Templates
          • Saving A New Chart Template
        • Using ChartLists
          • Creating A New ChartList
        • Chart Layouts
          • Accessing Chart Layouts
          • Creating A New Custom Layout
        • Additional Tools
          • Accessing Research Tools
    • Troubleshooting
      • Unable to Log In
      • Website Slow or Down
        • Using OpenDNS
      • Website Functionality Issues
    • Customer Support
    • Policies & Limitations
      • Terms of Service
      • Privacy Statement
      • No Service Level Guarantees
      • Data Policies
      • Usage Limitations
      • Reprint Permission Policies
      • Billing Policies
      • Membership Policies
      • Public ChartList Policies
      • Customer Support Policies
Powered by GitBook
LogoLogo

ON STOCKCHARTS

  • Charts & Tools
  • Articles
  • StockCharts TV
  • ChartSchool

MEMBERS

  • Your Dashboard
  • Your ChartLists
  • Advanced Scans
  • Technical Alerts

HELP

  • Support Center
  • FAQs
  • Contact Us
  • Pricing

COMPANY

  • About Us
  • What's New
  • Careers
  • StockCharts Store

© StockCharts.com, Inc. All Rights Reserved.

On this page
  • Manually Finding Divergences
  • Peak-and-Trough Analysis
  • Divergence Scanning Methods
  • Using Rising/Falling Clauses
  • Using Min/Max Functions
  • Conclusions

Was this helpful?

Export as PDF
  1. Scanning & Alerts
  2. Scan Writing Resource Center
  3. Scanning Case Studies

Scanning for Divergences

One of the most important technical signals to watch for on any chart is a divergence. To put it simply, a divergence occurs when prices move in one direction (up or down) and an indicator based on those prices moves in the opposite direction. In this article, you'll learn some ways to detect divergences with our Scan Engine.

Divergences signal impending changes in the direction of a stock's price. They come in two flavors—“positive” (AKA “bullish”) and “negative” (AKA “bearish”). A positive divergence happens when an indicator starts moving higher after prices have been in a downtrend (a potentially bullish development). A negative divergence occurs when an indicator moves lower while prices are still rising and is a bearish warning signal.

Any oscillating indicator can be used in a divergence study. Popular choices include the MACD, Stochastics, and Wilder's RSI. Many people also use indicators that include volume information—Chaikin Money Flow, for example - since price and volume often diverge at key turning points.

Unfortunately, like many things in the field of technical analysis, spotting divergences while they are still forming can be tricky. The biggest problem is distinguishing between a real divergence and random “noise” on the chart. The fact that a stock moves up for two days while one of its oscillating indicators (e.g., RSI) declines does not necessarily mean that a significant divergence has developed - yet.

Manually Finding Divergences

Peak-and-Trough Analysis

Often, peak-and-trough analysis is used to find divergences. If, for example, two or more rising troughs appear on the price plot (an uptrend) while two or more declining peaks appear at the same time on the indicator graph (a downtrend), a bearish divergence has been identified. This is how divergence is often taught in textbooks.

As with all forms of peak-and-trough analysis, there are two key problems with this approach. The first problem is that clear trendlines take time to form; the underlying trading opportunity associated with the divergence may be over by the time an unambiguous picture appears on the chart. The second problem is that identifying significant peaks and troughs is often very subjective - one person's significant peak is another person's random spike. For these reasons, peak-and-trough divergence detection is hard to automate (meaning you can't create scans for it) and it is best used for finding exit signals for existing positions.

Divergence Scanning Methods

Using Rising/Falling Clauses

Simple divergence scans can be created by selecting a somewhat arbitrary time duration (5 days, for example) and seeing if prices have increased by more than a given percentage while the associated indicator decreased by a different given percentage over that same period. Here's a sample scan that uses that technique:

[type = stock]
and [close > 5 days ago close * 1.025] 
and [[[macd line(12,26,9) - 5 days ago macd line(12,26,9)] / AbsVal(5 days ago macd line(12,26,9))] < -0.08 ]

In this example, the price must have increased by at least 2.5% over the past five days, while the MACD value must have decreased by at least 8%. Here's one of the charts that this scan returned on June 11, 2018:

While this technique is easy to program into a scan engine, its results are hit-and-miss. Many of the charts returned by this kind of scan are not really experiencing a negative divergence. A visual review of all stocks returned by this kind of scan is a necessity.

Using Min/Max Functions

A different technique is to use the Min and Max functions to ensure that we are at the highest (or lowest) point on the chart for a given time duration. If the stock's price is higher than it was at any point in the past 5 days (for example) and the indicator is currently lower than it ever had been during that same period, there's a good chance a divergence is occurring. Here's a sample scan that uses that technique:

[type = stock]
and [close > yesterday's max(5,close)] 
and [CMF(20) < yesterday's min(5,CMF(20))]

In this example, we're looking for stocks that closed higher than the highest close during the previous five days and has a Chaikin Money Flow (CMF) reading that is currently lower than the lowest reading during the previous five days. Here's one of the charts that this scan returned on June 11, 2018:

This technique is not foolproof either; it requires a visual inspection of the results to determine whether a divergence is actually taking place.

Conclusions

Even though the results require some manual analysis, divergence scans are well worth incorporating into your stock-hunting toolkit. While no divergence scan is perfect, the two techniques above are good starting points that can be customized to suit your trading style. These scans can help you identify a smaller pool of possible divergence candidates, which can then be manually reviewed using traditional peak-and-trough analysis.

PreviousScanning for "Near Crosses"NextScanning for Relative Strength

Last updated 11 months ago

Was this helpful?