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
  • Using the Plus and Minus Operators
  • Using the Multiplication Operator
  • Using the PctDiff() Function
  • Other Uses for Near Crosses
  • Stocks within 5% of their yearly high
  • Stocks within 2% of their yearly low
  • Close within 3% of the daily high
  • Conclusions

Was this helpful?

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

Scanning for "Near Crosses"

PreviousScanning for CrossoversNextScanning for Divergences

Last updated 1 year ago

Was this helpful?

Crossover scans are often used to find stocks that are undergoing some kind of change, but sometimes nearly crossing over a benchmark is as good as actually crossing it. For example, it is useful to know that a stock's price came very close to its 20-day moving average, even if it didn't quite cross above that average. There are a number of ways to scan for these “near crosses,” as we'll discuss below.

Learn More.

Using the Plus and Minus Operators

The simplest way to search for a near cross is to use the “+” or “-” arithmetic operators. Let's say we want to look for stocks that are within 50 cents of their 20-day simple moving average. This can be done with a simple scan clause that compares the closing value to the 20-day moving average minus 50 cents:

[type = stock]
and [close >= SMA(20,close)-0.50]

This will find stocks that are no more than 50 cents below their 20-day moving average. However, it will also find stocks that are $10 above their moving average. Usually, you're going to be interested in stocks that are near their moving average (in the neighborhood of having a crossover), so you'll want to put in a clause that sets an upper limit for the close as well:

[type = stock]
and [close >= SMA(20,close)-0.50]
and [close <= SMA(20,close)+0.50]

Now the scan will find stocks that close up to 50 cents above or 50 cents below their moving average. For example, if the moving average of a stock is $15.00 and the closing price is anywhere between $14.50 and $15.50, it will be found by this scan.

Using the Multiplication Operator

One major limitation of using the “+” and “-” operators is that they use a flat amount to calculate the range. 50 cents is a huge amount when you're looking at a $5 stock, but barely even registers when you're looking at a $500 stock.


For this reason, many scanners prefer to use percentages when scanning for near crosses. Let's say we're interested in scanning for stocks that are 4% above or below their 20-day moving average:

[type = stock]
and [close >= SMA(20,close)*0.96]
and [close <= SMA(20,close)*1.04]

The scan is very similar, but, instead of subtracting or adding 50 cents, we will subtract or add 4% from the moving average. 100%-4% is 96%, so we will multiply the moving average by 0.96 (96%) to get the lower limit. Similarly, we will multiply by 1.04 (104%) to set the upper limit at 4% above the moving average.

The advantage of using percentages is that it takes the stock price variable out of the equation. On a $5 stock, 4% is 20 cents, while on a $500 stock, it is $20. So when you use this percentage technique, the definition of “near” scales right along with the price. This is very useful if you are interested in both high- and low-priced stocks in the same scan.

Using the PctDiff() Function

Just like the multiplication operator, the PctDiff() function can be used to scan for near crosses based on percentage.

[type = stock]
and [PctDiff(close,SMA(20,close)) >= -4]
and [PctDiff(close,SMA(20,close)) <= 4]

In the scan above, the lower limit is set by specifying that the difference between the close and the moving average is 4% below (“-4”) the moving average. The upper limit is set by specifying that the difference is 4% above (“4”) the moving average.

The PctDiff() function does the exact same calculations as the multiplication operator. Use whichever syntax you are more comfortable with.

Other Uses for Near Crosses

When we talk about near crosses, most people think of examples like the ones above, where the close is nearly crossing above its moving average, but this syntax can be used to scan for near crosses of volume, indicator values and more. You can use these techniques to scan for anything being near to anything else.

One of the most common alternate uses is to find stocks near a previous high or low. In these examples, you're essentially searching for stocks that “nearly crossed” their historical high or low value.

Stocks within 5% of their yearly high

[type = stock]
and [today's high > yesterday's max(252,high) * 0.95]

Note: The upper limit clause is often left out when scanning for stocks near a high. As a result, this scan would also find stocks that are far above their yearly high.

Stocks within 2% of their yearly low

[type = stock]
and [today's low < yesterday's min(252,low) * 1.02]
and [today's low > yesterday's min(252,low) * 0.98]

Note: This example includes both the upper and lower limit. Some scanners might leave out the lower limit clause on a scan looking for lows.

Close within 3% of the daily high

[type = stock]
and [close > high * 0.97]

Note: This last example is a little different in that you are looking for stocks that closed near the top of the day's range (that “nearly crossed” the day's high). Obviously, the close would not be higher than the high for that day, so there is no need to add an upper limit clause here.

Conclusions

There are several scanning techniques available when scanning for near crosses. These are often used to scan for stocks whose prices are near their highs, lows or moving average.

When scanning for “nearness,” we strongly recommend that you use percentages rather than a fixed amount. This takes price out of the equation and allows your scan to find both high- and low-priced stocks that meet your criteria.

Writing Crossover Scans