Gord Greer's Scan Building Blocks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scans:library:scan_building_blocks [2019/07/01 21:26] (current)
Line 1: Line 1:
 +====== Gord Greer'​s Scan Building Blocks ======
  
 +Gord Greer is a long-time StockCharts.com member and an experienced Scan Engine user who has been helping people with their scanning questions for many years. In this page, we present a set of scan building blocks that he uses to create new scans.
 +
 +Scan building blocks are just what they sound like: little snippets of scan syntax that you can plug into new scans as you build them. If you have a standard set of scan clauses that you use over and over in many scans, you can even create a "scan template"​ with your own building blocks and use it as a starting point for new scans you create.
 +
 +**Learn More:** [[:​scans:​advanced_scan_workbench:​templates|Creating Your Own Scan Templates]]
 +
 +**//Note: StockCharts.com makes no claims about the effectiveness of these scans for trading purposes. These scans should only be used for educational purposes, as a way for you to develop your own personal trading strategy.//​**
 +
 +----
 +
 +===== Gord's Building Blocks =====
 +
 +==== General Layout ====
 +
 +This building block contains multiple clauses connected with "​and"​ and "​or"​ operators to help define the general layout of a scan. Of course, you would need to insert your actual scan clauses into this framework when you use it to build your own scan.
 +
 +<​code>​
 +// Sample scan layout
 +[type = stock]
 +and [1st criteria]
 +and [2nd criteria]
 +and [ [3rd criteria] or [4th criteria] ]
 +</​code>​
 +
 +==== Universe Definition ====
 +
 +Most people use the same one or two universe definitions over and over again, so these building blocks are great candidates for a scan template. Universe-defining clauses can cover everything from security type to country to exchange to even simple liquidity requirements using average price and/or volume. Here are Gord's building blocks that fall in this category. (Your building blocks should define the universe of securities that //you// are interested in trading.)
 +
 +=== Type ===
 +<​code>​
 +[type = stock]
 +[type = index]
 +[type = fund]
 +</​code>​
 +
 +=== Country ===
 +<​code>​
 +and [country = us]
 +and [country = canada]
 +</​code>​
 +
 +=== Exchange ===
 +<​code>​
 +and [exchange = NASDAQ]
 +and [exchange = NYSE]
 +and [exchange = AMEX]
 +and [exchange = PINK]
 +and [exchange = TSE]
 +and [exchange = CDNX]
 +</​code>​
 +
 +=== Group ===
 +<​code>​
 +// S&P 500
 +and [group is SP500]
 +
 +// S&P 1500
 +and [ [group is SP500] or [group is SP400] or [group is SP600] ]
 +</​code>​
 +
 +=== ChartLists ===
 +<​code>​
 +// "Watch list" ChartLists grouped together with OR clauses
 +and [ 
 +  [favorites list = 13] 
 +  or [favorites list = 24]
 +  or [favorites list = 63]
 +  or [favorites list = 67]
 +  or [favorites list = 71]
 +]
 +</​code>​
 +
 +//Note: Your own ChartList numbers will be different, of course. Using OR clauses allows you to search multiple ChartLists for a single criteria. Learn more in our [[:​scans:​advanced_scan_syntax:​chartlist_scans|Scanning Your ChartLists]] article in the Support Center.//
 +
 +=== Liquidity ===
 +<​code>​
 +// Liquidity: average dollars traded per day > $500,000
 +and [SMA(50,​close) * SMA(50,​volume) > 500000] ​
 +</​code>​
 +
 +//Note: Price and volume criteria can be added in separate clauses. In this building block, they are combined to scan for an average liquidity (dollars traded per day) of more than $500,000.//
 +
 +=== Scan Development Clauses ===
 +<​code>​
 +// Price Bracket: $10-$20 (used during scan development)
 +and [close >= 10] and [close <= 20]
 +</​code>​
 +
 +//Note: It is often helpful to artificially limit the scan results while developing a scan. Gord likes to use a price bracket like the above building block to temporarily limit the results returned by the scan. These temporary development clauses will need to be removed once you have finished developing the scan.//
 +
 +==== Conditions and Signals ====
 +
 +While conditions and signals vary from scan to scan, some criteria are used so frequently in scans that it is worthwhile to create a building block. Here are Gord's building blocks for his most commonly-used conditions and signals. You may want to change the parameters used in these building blocks, or even change entire scan clauses, to better suit your trading style.
 +
 +=== Uptrends and Downtrends ===
 +
 +The scan below finds securities where the RSI(14) values for the last 75 days are all above 40.
 +
 +<​code>​
 +// Uptrend: RSI Above 40
 +and [min(75,​RSI(14)) >= 40.0]
 +</​code>​
 +
 +The scan below finds securities where the RSI(14) values for the last 75 days are all below 60.
 +
 +<​code>​
 +// Downtrend: ​ RSI Below 60
 +and [max(75,​RSI(14)) <= 60.0]
 +</​code>​
 +
 +The scan below finds securities where the MACD values for the last 130 days (approx. 6 months) are all above zero.
 +
 +<​code>​
 +// Uptrend: MACD Positive for 6 Months
 +and [min(130, MACD Line(12,​26,​9)) > 0.0]
 +</​code>​
 +
 +=== Convergence/​Consolidation ===
 +
 +The scan below finds securities where the 20-day, 100-day and 200-day simple moving averages (SMAs) are all within +/-1% of the 50-day SMA.
 +
 +<​code>​
 +// Long-term SMA convergence
 +and [SMA(20 ,close) >= SMA(50,​close) * 0.99] 
 +and [SMA(20 ,close) <= SMA(50,​close) * 1.01] 
 +and [SMA(100,​close) >= SMA(50,​close) * 0.99] 
 +and [SMA(100,​close) <= SMA(50,​close) * 1.01] 
 +and [SMA(200,​close) >= SMA(50,​close) * 0.99] 
 +and [SMA(200,​close) <= SMA(50,​close) * 1.01] 
 +</​code>​
 +
 +The scan below finds securities where the 3-day, 10-day and 40-day simple moving averages (SMAs) are all within +/-1% of the 20-day SMA.
 +
 +<​code>​
 +// Short-term SMA convergence
 +and [SMA(3,​close) >= SMA(20,​close) * 0.99]
 +and [SMA(3,​close) <= SMA(20,​close) * 1.01]
 +and [SMA(10,​close) >= SMA(20,​close) * 0.99]
 +and [SMA(10,​close) <= SMA(20,​close) * 1.01]
 +and [SMA(40,​close) >= SMA(20,​close) * 0.99]
 +and [SMA(40,​close) <= SMA(20,​close) * 1.01]
 +</​code>​
 +
 +The scan below finds securities where the maximum and minimum close for the last 20 days are within +/-2% of today'​s 20-day simple moving average (SMA).
 +
 +<​code>​
 +// Intermediate-term price consolidation
 +and [max(20,​close) <= SMA(20,​close) * 1.02] 
 +and [min(20,​close) >= SMA(20,​close) * 0.98]
 +</​code>​
 +
 +The scan below finds securities where the maximum high and minimum low for the last 10 days are within +/-2% of today'​s 10-day simple moving average (SMA).
 +
 +<​code>​
 +// Short-term price consolidation
 +and [max(10,​high) <= SMA(10,​close) * 1.02]
 +and [min(10,​low) >= SMA(10,​close) * 0.98]
 +</​code>​
 +
 +The scan below finds securities where the maximum and minimum close for the last 20 days are within +/-3% of today'​s close.
 +
 +<​code>​
 +// Price Channel Convergence
 +and [min(20,​close) > close * 0.97] 
 +and [max(20,​close) < close * 1.03]
 +</​code>​
 +
 +=== Signals or Other Unusual Activity ===
 +
 +The first two clauses scan for consolidation,​ as the maximum and minimum close for the 30 days prior to yesterday must be within +/-3% of yesterday'​s 20-day simple moving average (SMA). The remaining clauses scan for the breakout: today'​s close must be at least 5% above or below today'​s 20-day SMA.
 +
 +<​code>​
 +// Consolidation Then Breakout
 +and [1 day ago max(30,​close ) <= 1 day ago sma(20,​close) * 1.03] 
 +and [1 day ago min(30,​close ) >= 1 day ago sma(20,​close) * .97] 
 +and [ [close > 1 day ago sma(20,​close) * 1.05]
 +          or [close < 1 day ago sma(20,​close) *0.95] ]
 +</​code>​
 +
 +//Note: The OR clause finds stocks that are breaking out in either direction, but you can modify this if you are only interested in bullish breakouts.//​
 +
 +In the scan below, the use of the OR clause allows you to simultaneously scan for multiple different kinds of unusual activity that might be of interest, including sudden spikes in volume or price over the last couple of days.
 +
 +<​code>​
 +// Scan Universe for Unusual Activity
 +and
 +[ [0 days ago volume > 1 day ago sma (60, volume)*1.25]
 +or [1 days ago volume > 2 days ago sma(60, volume)*1.25]
 +or [2 days ago volume > 3 days ago sma(60, volume)*1.25]
 +or [0 days ago close > 1 day ago close * 1.05]
 +or [1 days ago close > 2 day ago close * 1.05]
 +or [0 days ago high > 1 days ago close * 1.05]
 +or [1 days ago high > 2 days ago close * 1.05] ]
 +</​code>​
 +
 +//Note: This scan is ideal for scanning your watch lists or some other small universe of stocks.//
 +
 +===== Conclusions =====
 +
 +Remember, these are just the scan building blocks that Gord uses. Your investment needs and trading style will be different than his, so use these as inspiration to develop your own scan building blocks. ​
 +
 +Once you've gathered your most-used building blocks, consider turning them into a scan "​template"​ so you can quickly and easily access your building blocks whenever you create a new scan.
 +
 +===== Additional Resources =====
 +
 +==== Support Center Articles ====
 +  * [[:​scans:​advanced_scan_workbench:​templates|Creating Your Own Scan Templates]]
 +  * [[:​scans:​planning|Planning Scans]]
 +  * [[:​scans:​advanced_scan_syntax|Writing Scans]]
 +
 +==== Reference Guides ====
 +  * [[:​scans:​reference|Scan Syntax Reference]]