Scanning Technically

SCAN - Q: Why didn't may scan pick this up days sooner?


I have a simple section of a more complicated scan that doesn't seem to be working properly and I'm not sure if there is an error in the logic or am I missing something ?

The simple part of my scan is looking for the SMA 5 close crossing above the SMA 10 close.

[type = Stock]
and [SMA(5,close) X  SMA(10, close)]

I usually run this scan after the close each day and it did pick up several stocks on May 27, but when I look at the charts I don't know why it didn't pick them up days earlier on May 23.  Is this an error or am I missing something, here is a close up of a few of the charts and a zoomed in version of a few days before May 27  which clearly shows it crossed on May 23.


Great question and you are not the first one to question this condition.  So lets check the chart in question by zooming in on the chart and the data.

First thing we have to realize is the non-trading weekend days (Sat and Sun) are not plotted on the chart, so every weekend we will have 2 blank dates before the next trading day.  In this particular case it was a holiday weekend so there were 3 blank days and since this is an EOD (end of day) scan, the next data point is actually after the close on the 4 day.  So when comparing the closing values one day to the closing values the next trading day, they can often be several calendar days apart.

Yes, in the chart above,  it does visually appear that the SMA's crossed over during the day on May 23.  However we have to remember that we are looking at closing values of OHLC and the SMA's represented in a candlestick format and as such we can vary the width of the candlestick by the chart size and candle width settings.  It's easy to think of the left side of the candle as the opening at 9:30am and the right side of the candle as the close at 4:00pm, but this is not the case.  They are just spread out so we can easily see the type of candle, ( red, black, hollow, filled).

With respect to the SMA's in question we could plot them as a single dot each day or as a sloped line connecting the dots.  The line method is popular because it is easy to see the up and down trends.  The trend line will look like a sloped line connecting the value yesterday, rising thru the evening, early morning, afternoon and closing higher at the next trading days value.  When in actual fact the indicator is not changing overnight or thru the weekend, it is frozen at the current value until the next closing value is finalized / published, ie: we have no way of knowing whether the line should be up / down or sideways until after the close the next trading day.  Thus when looking at only a few days, its better to see the chart as single dots or as a step chart, (staircase) as I've drawn below.

With respect to the chart in question I have zoomed in to see the exact closing values on May 23 and although they are very close, the SMA5 is still below the SMA10, thus the criteria for a crossover was not met on May 23.

I hope this answers the question and clears up any confusion as to when a scan should pick up a hit.

To learn more about writing scans I suggest attending ChartCon 2014.  Chip and I will be reviewing how to create scans for fun and profit,  I'm sure you will learn all sorts of new techniques and tricks for writing great scans.  I will also be hosting an After Dark session on how to troubleshoot, verify and fix your problem scans.

For the full list of great speakers and agenda see the ChartCon2014 webpage

Hope to meet you there,


Developing a Scan; Define Your Universe....

The first few lines define your development scan universe and these are mostly primary database variables.  The scan base is basically; Open, High, Low, Close & Vol, everything else has to be calculated.  So it helps the scanning speed and reduces the server load by using primary data first to limit the number of heavy calculations.

I treat Development scans a little differently than finished research scans.  For Development I'm basically only interested in single stock issues, no mutual funds or commodity contracts, no indexes or baskets of stocks (ETF's).   Thus my opening filter is;

[type = Stock]

Now for a development scan I need to make sure I will get enough hits (100-200), so I usually don't select a region/country or define any exchanges.  This way by default I cover all the exchanges in the USA and Canada.  If you're only a US trader you may want to restrict your scans to the US, but for development leaving it open gives you the option of more hits.

            and [country is US]

I also want stocks that behave well under Technical Analysis, so I will set a minimum price, (not interested in pennies as they are often manipulated and trade heavily on news or on pump & dumps rather than the Technicals), and I will also set an upper limit to be used for reducing the number of hits.  So lets say $1 min. and $20 max, there are a ton of stocks in this price bracket so I usually don't have any trouble getting hits.

            and [ close > 1 ] and [ close < 20 ]

I also want to eliminate any stocks which are very thin traders, so lets set a min volume greater than 500,000

            and [ volume > 500000 ]

Now here at the end is where you place your technical scan criteria, all the calculated stuff like SMA's, BollingerBands, MACD's etc.  Thus the heavy scan calculations are only preformed on a much reduced list of possible candidates.  This could be your own scan or parts copied and pasted from predefined scans.

Depending on your scan you may get 999 hits, in this case I just reduce the price bracket, sometimes even as low as say $10.00 to $10.25, what I want is about 100-200 hits.  I then start reviewing the charts with a chartstyle I have set up specifically to verify this scan.  I eliminate everything on the chart except what's critical in the scan and shorten the time frame down to maybe just a few days, that way it's easy to visually see the data.  For future reference I also put a link to this chartstyle in the scan as a comment, this eliminates having to recreate it again at some future time.

Here are two charts; 12 months, vs 20 days, with the SMA 20 X SMA 50, on the 12 month you gotta look at the numbers, but on the 20 day you can just scroll by to verify. 

Now I use the 10 / page mode to quickly scroll thru and visually check for compliance.  Now if there's a mistake in the logic I will usually see it in the first 10 or 20 charts.  IE charts which don't meet all the criteria, at this point there's no need to review any more charts.  Remember what part of the charts didn't meet the criteria and just go back check and adjust the criteria, then re-run the scan.  For simple scans once I see correct results for 20-30 charts I usually stop, but to increase your confidence in the scan just review more charts.

Optional Criteria:

- You may want to use a basket rather than a price bracket, so add S&P500 or S&P1500 as comments, that way its easy to just turn them on if you want, just remove the"//".

            // and [ group is S&P500 ] 
           // and [ [ group is SP500 ] or [ group is SP400 ] or [ group is SP600 ] ]

The last thing you want to do is save this scan so you can use it again and again as a starting point for scan development.  I have several basic scan intro's for different purposes, as this is a Development scan I would name it " 0 ADV DEV", 0 so its at the top on my list, ADV because its an Advanced Workbench scan and DEV because its for Developing scans.

Hope this gives you some new ideas,
cheers Gord

Why Do My "After the Close" Scan Results Change?

Q: Why do I get different results when I run a scan at the close, a few minutes later and then a few hours later.  The scan criteria is the same and the mathematical formulas are the same.  How can the timing of my after the close scan change the math and give me different results ?

A:  Very good question, it doesn't happen often but if you run alot of scans you will occasionally come across this situation.  There are multiple reasons for this, lets look at some of the common causes.  Note this is only a general overview of the basics.

1) Alot happens right at the close and within the next few minutes, the exchanges are very busy trying to accurately close out the day before after hours trading begins.

 - The books are balanced, any errors are corrected and the closing price is set.
 - All the EOD (trade at close) orders, account swaps, EOD block trades etc are processed, this won't change the closing price but it will change the volume.
 - The shareholders of record are determined, this is important for the distribution of dividends or splits etc which will be occuring EOD for specific stocks.
 - Official EOD numbers are set.

All of the above should happen before the after hours trading market opens.

2) Stockcharts begins their updates after step 1 is complete.

 - Once the official numbers are released Stockcharts can then start updating their databases.
 - For stocks which have gone EX dividend the historic data will be adjusted
 - For stock spits or consolidations the historic price and volume are adjusted

All of the above is done manually and may take a couple of hours depending on the volume of adjustments.  The end of the month and in particular end of the quarter tend to be very busy times for dividend & split adjustments.

For recent data adjustments you can check the "Recent Data Adjustments" link on the right side of the FreeCharts page under the "Other Tools" menu.

For more indepth reading on data accuracy see this article.

Thus in summary when running scans just after the close, a few minutes later or even several hours later be careful how you interpret the results.  The math doesn't change but the underlying databases used for the calculations can change.  The closing price is the same however the closing volume may change and with dividend adjustments the historic prices and volume may also change.  These changes will also affect the values calculated for the indicators and overlays which are contained in your scan, which is why the results may occasionally change during this period between the close and completion of all the update adjustments. 



Writing a Scan, How Does "YOUR" Mind Think?

Have you ever read the scanning documentation or reviewed someone else's scan coding and thought this  just doesn't make sense to me, well you are not alone it happens to all of us.  We are not identical computers running the same version of software, we are individual, (and thats a good thing).

Scans are mathematical relationships between various variables and by default we all think of those relationships a little differently.  Here's a few examples to get you thinking outside of "YOUR" box.

In the following case A is greater than B, but from the other side B is less than A, what was Your first thought?

A B blocks

Now lets review some of the mathematical relationships between A & B and the various ways we could write them.  Remember mathematical relationships are usually read from left to right, ie A is greater than B, (A > B) however the converse is also true, as read right to left, ie B is less than A, (B < A).  Here's a table of just a few of the relationships we could write about the A & B example shown above.  Note they all describe the same thing, just stated in different ways from a different point of reference and if used in a scan they would all yield the same results.

Math formulas

Now lets apply this to a couple of chart scan examples and we'll be looking for < or >, rather than = , and we'll also replace A & B with actual technical variables.

1- Looking for todays close to be more than 25% above todays SMA-50 of the close.  [ A > B * 1.25 ]

    and [Close > SMA(50, Close) * 1.25]

This is the chartstyle I would use for laying out the scan and maybe a slightly shorter period for checking the scan.  Note the use of the SMA envelopes to easily see the +/- 25% lines around the SMA-50

Chart close 125%

2- Or looking for the same thing using a different formula we could use the following.  [ A < B * 0.8 ]

    and [SMA(50, Close) < Close * 0.8 ]

Similar layout and checking chart, although in this case we are looking for the +/- 20% lines around the closing price.  We can still use the SMA envelopes, the trick is to set the SMA to a value of 1 period, (ie the close).

Chart close 80%

So in summary there is almost always more than one way to write a scan.  I like " [ A > B * 1.25]", but some like to see it as " [ B * 1.25 <  A ]" or "[ A * 0.8 > B ]", all depends on how "Your" mind thinks.  Just get comfortable with your prefered format and when you save someone else's scan for future reference just modify it to your way of thinking and maybe add a few comment notes.

happy scanning




** Addendum notes, additional details

With my engineering background I have been working with mathematical relationships for over 50 years, thus the above comes easily without even thinking about it.  However if this is not your background you may find these extra notes will help get you on the right track.

 Part I, defining the relationship graphically

First when thinking about mathematical relationships define a scale that works for you in determining the relationship graphically.  It doesn't really matter what scale as long as you use the same one for both sides, A&B.  Then ignore the greater than or less than signs, just work on how to make them equal, you can move on to the , < or > signs later.

1) Lets start with numbering the blocks 1, thru 5.  Thus if A is 5 blocks and B is 4 blocks, then we could write the equation, A times 4/5 = B.   Looking at it from the other side if B is 4 blocks and A is 5 blocks, we could write B times 5/4 = A.

                        A * 4/5 = B                 B * 5/4 = A

Now lets simplify this a bit,  4/5 = 0.8   and  5/4 = 1.25,  so the above can be rewritten as;

                        A * 0.8 = B                 B * 1.25 = A

2) Lets try a different scale numbering system, we'll make the value of A = 100, thus the five blocks of A become 20, 40, 60, 80, 100 and using this scale B = 80.  Thus the relationship could be written as A times 80/100 = B  or B times 100/80 = A.

                        A * 80/100 = B           B * 100/80 = A

Again lets simplify this a bit,  80/100 = 0.8   and  100/80 = 1.25,  so the above can be rewritten as;

                         A * 0.8 = B                 B * 1.25 = A

3) Lets try a different scale numbering system, this time we'll make the value of B = 100, thus the four blocks of B become 25, 50, 75, 100 and using this scale A = 125.  Thus the relationship could be written as B times 125/100 = A  or A times 100/125 = B.

                        B * 125/100 = A         A * 100/125 = B

Again lets simplify this a bit,  125/100 = 1.25   and  100/125 = 0.8,  so the above can be rewritten as;

                        B * 1.25 = A               A * 0.8 = B

Notice how even when using different scales, the mathematical relationships still simplify to the same basic formulas.  The scaling method you use just depends on which way your mind likes to think and whether you want to define A in terms of B, or B in terms of A.

Now you may also want to brush up on a little high school Algebra, just Google it there are lots of tutorials.  But basic Algebra also lets us manipulate the formulas once we have one valid relationship.

The basic premise is that as long as we do the same thing to both sides of the equation, the equation is still valid.  So lets start with;

            B * 1.25 = A

Divide both sides by 1.25

  B * 1.25 /1.25 =   A / 1.25     simplify    B * 1 =   A /1.25  simplify    B  = A * 0.8   or   A * 0.8 = B             

So again we arrive back at the same formulas we developed graphically above but this time we've used some basic algebraic manipulation.  I could continue, but I'll let you do your own DD.

Part II, the charts used for verifying and troubleshooting the scan.

I find when verifying and troubleshooting a scan, the quickest and easiest way is to create a chartstyle that highlights only what is in the scan.  This is not a chartstyle I would use for Technical Analysis, its focused on just the scan parameters I want to verify and I want to see them graphically so I can visually check at least 50 charts in a few seconds without having to look and compare individual numbers on each chart.

Limit the chartstyle to only the key parameters in the scan.  If the scan involves things that happened in the last 5 days, do not look at a 12 month chart, look at a 10 day chart.

Use indicators and overlays set up to highlight the parameters of your scan, performance charts are also helpful when the scan involves percent change.

For review I use the 10 per page view and I can quickly scroll thru 50 charts in a couple of minutes.  If the scan is fairly simple and the parameters can be seen on a small chart I'll save a CandleGlance chartstyle and then can review 30 charts per page quickly.

Cheers ,

Scanning to Find Stocks with Selling Climaxes

A selling climax occurs when a stock falls sharply on extremely high volume. As the name infers, a selling climax suggests that selling pressure has peaked and traders should expect some sort of rebound. Think of this selling pressure as a stretched rubber band, which cannot stretch forever. At some point, the rubber band either breaks or snaps back. In chart terms, a rubber band break would be the equivalent of a complete meltdown in prices. A snap back implies an oversold bounce that retraces a portion of the prior decline.

With a high-volume decline over the last few weeks, several stocks have experienced selling climaxes that could give way to oversold bounces. Though not perfect, chartists can find some these stocks by devising a scan to capture this high volume decline. The scan criteria below are designed to find stocks that became oversold on high volume and are still trading near their lows. Chartists can copy and paste this code into the advanced scan workbench.

[type = stock] AND
[country = US] AND
[Daily SMA(20,Daily Close) > 10] AND
[Daily SMA(20,Daily Volume) > 40000] AND
[Daily SMA(2,Daily Volume) > Daily SMA(250,Daily Volume) * 2] AND
[BB Width(10,2) > Daily SMA(250,BB Width(10,2)) * 2] AND
[Daily MIN(5,RSI(14)) < 25] AND
[Fast Stoch %K(14,3) < 10]

The first four lines simply qualify the symbol universe. The type is set for stocks, the country is the US, the 20-day price average is above $10 and the 20-day volume average is above 40,000 shares.

[Daily SMA(2,Daily Volume) > (Daily SMA(250,Daily Volume) * 2)]
Line four looks for stocks where the average volume of the last two days is at least twice the 250-day average for volume. This insures extremely high volume.

[BB Width(10,2) > Daily SMA(250,BB Width(10,2)) * 2]
Bollinger Band Width is a measure of volatility. In this example, we are looking for the BB Width (10,2) to be at least twice the 250-day average of BB Width (10,2). This insures that we have seen an expansion in volatility.   

[Daily MIN(5,RSI(14)) < 25]
Line six looks for stocks where 14-day RSI dipped below 25 at some points in the last five days. This insures that the stock moved lower and became oversold over a 14-day period, not just for a few days. Note that 30 is normally used for oversold readings. Using 25 insures an extra degree of oversold-ness.

[Fast Stoch %K(14,3) < 10]
Line seven looks for stocks with the Fast Stochastic Oscillator below. The Stochastic Oscillator measures the level of the close relative to the high-low range over the last fourteen days. A Stochastic Oscillator below 10 insures that the current close is near the low end of this range. This last criterion is used to cancel out stocks that have already bounced.

Click this image for a live chart

The chart above shows Whirlpool (WHR) meeting these scan requirements on Monday, February 3rd. Notice that WHR did not meet these requirements with the big decline two days earlier. Even though volume and the Stochastic Oscillator met the requirements, RSI did not break below 25 to confirm an oversold condition. Keep in mind that these are just guidelines and chartists can tweak the settings to fit their scanning needs.

What's Wrong with this Bearish MACD Crossover scan?


I inserted a predefined scan in the advanced scan workbench for a "Bearish MACD Crossover", however I'm not sure it's right.  I just cleared out all the default criteria and then selected and inserted the predefined Bearish MACD Crossover.  Here is the actual coding.

Scan code

 The coding seems to make sense until the last line which I think may contain some typos.  I understand there is a numerical relationship between signal and line, but what is the relationship between signal and histogram?  Also could someone explain what *0.25 means in the last line…  thanks.


 Actually this scan is correct for what it's doing, it's just a little more sofisticated than a basic crossover scan. In its simpilest form the scan could be just the first 4 lines.   However in this case, to eliminate picking up weak crossovers the scan adds the last 3 lines to ensure some stability and actual separation of the line and signal before the cross.  Note you can also modify this scan to suit your own needs and save it to your scan list.

 First lets be clear on what the MACD Histogram is.  It's just the numerical difference between the MACD Line and the MACD Signal, but it's plotted as a bar histogram along the "zero" line.  Here's a graphical representation.

Now lets look at a graphical presentation of the whole scan, I find it often makes more sense than just looking at the math coding.  I've annotated each line of the code onto the chart for each of the days in the past.

Bear MACD cross

 Now lets look at the coding in question, the last line.

 and [3 days ago macd hist > 3 days ago macd signal * 0.25]

 Remember the Histogram is just the difference between the Line and the Signal, in this case we want some significant separation, ie 25%.  Still confused ? how about if the last line was coded differently, like the following.

 and [3 days ago macd line > 3 days ago macd signal * 1.25]

 For many users this might seem to make more sense, however its the same as the previous line, just stated in a different way, (getting from one to the other just takes a little algebra).  Our minds all think a little differently and what is the default for one person, seems backwards or just plain confusing to another.  It all depends on how you view numerical relationships.  Some people think "A" is BIGGER than "b", while others will instantly think "b" is smaller than "A".

Looking at just the last line here is a graphical representation of 4 different ways the same coding could be written, (and there are more).

MACD to Signal var

 Now for those who are still not sure, here's the algebra behind how we get from one coding line to the next.


 I hope this  gives you a different view on the subject of scanning and writing code.


How can I see exactly what a predefined scan is doing and can I modify it?

 Well the short answer is yes, if you have an Extra level subscription or higher.  Basic or Free members can only review the output list of predefined scans.

 In the Standard Scan workbench there are two ways to add a predefined scan.

 1 - Under the "Global Filters" section just select the predefined scan in the drop down box.  This will add only the filter title, it does not show you the coding details and does not allow modifications.


2 - Under the "Additional Technical Expressions" section, select and insert the scan.  This is the method you want in order to see the coding details and allows you to modify them.

Method 1 -


Method 2 -


As you can see the coding is inserted in the "Technical Expression" workbench section and also displayed in the Criteria summary at the top.

    • 50-day Simple Moving Average of Close for today is greater than 200-day Simple Moving Average of Close for today
    • 50-day Simple Moving Average of Close for yesterday is less than or equal to 200-day Simple Moving Average of Close for yesterday

Now you might notice that this is the long hand version of the cross-over function, "X" and this scan could have been written more simply as shown below.  3

 However the long version offers us a few more options.  Say you really want something on a little shorter time frame, the SMA-20 crossing above the SMA-50, well just change the 50 & 200 to 20 & 50.


But we only want crossovers that are significant, not the ones in the noise level that are bouncing around and crossing by tiny tiny amounts.

Let's say rather than just being greater than today, we want the SMA-20 to be at least 1% greater.  So we would multiply the SMA-50 by 1.01 which will add some significance to the cross.

Now we could also modify the pre-cross section to ensure that it was significantly below in the past.  Lets go back 2 days instead of 1 and require the SMA-20 to be at least 1% less than the SMA-50 at that point.  So we would change the 1Days to 2Days and multiply the SMA-50 by 0.99 (which reduces it by 1%)  6

When I ran this scan as of the close Jan 9th 2014, the modifications narrowed the hits from 113 to 18.

 Finally one of the best ways to review, analyze and verify your scan is to look at it graphically.  This is also a great method to use when planning out and developing a scan as it helps visualize breaking up a large scan into smaller sections of code.


Happy scanning and always verify your scan outputs with a review of the charts, as what you think you asked for is not always what you really asked for. 

Gord Greer


Modify, Develop and Test a Custom Scan

Some of you might recognize this example from a CSTA webinar I did last Dec, but I thought it was a good time to update and share it with all StockCharts users.  The example starts with a simple predefined scan and shows how it can be modified, step by step.

(Note the techniques described use the advanced scan interface for writing custom scans, thus you will require at least an Extra level membership to create these scans).

When reviewing the charts for the S&P500 index we see that the index closed above the Feb and April levels.  Now individual stocks don't always follow the index exactly but we can use the scan engine to find which are leading or lagging the index.  Also we have to be aware that the $SPX is the S&P 500 market cap weighted index, ie Exxon and Apple account for 6% of the index.  We could also look at the $SPXEW which is the equal weighted S&P-500 index where each of the 500 stocks accounts for 0.2%, this index exceeded the Feb highs in April and exceeded the April highs today.


So lets find out how the individual stocks in the index are doing.  We'll limit our initial scan to the S&P-500 and insert one of the predefined scans "New 52 week high".

1 input

Now running this scan yields 98 hits, but I'm more interested in closing values than the daily highs and really only interested in looking back into Jan.  Now we could change only todays high to a close above the previous intra-day high but in this case I'll change both the "highs" to "close" and just look for the previous maximum back say 90 days instead of 260 trading days.

[type = stock]
and [group is SP500]
and [today's close > yesterday's daily max(90,close)]

This gives us 113 hits. 
But I know some stocks in the index may not have had a new high close today, they may have had a new high a few days ago and pulled back a few cents today.  So lets look for a new high close anytime during say the last 5 days which is higher than the highest close for the previous 90 days (starting 6 days ago).

[type = stock]
and [group is SP500]
and [max(5, close) > 6 days ago daily max(90,close)]

This gives us 163 hits, which corresponds to 32% of the stocks in the S&P-500 hitting a recent new high close in the last 5 days.  But I'm also interested in what the Small and Mid cap stocks are doing so I'll add them to the list and by using the comment prefix of // or #, we can turn these individual clauses ON and OFF.  (any line prefixed with // or # is considered a comment and not evaluated)

[type = stock]
// and [group is SP500]
and [group is SP400]
// and [group is SP600]
and [max(5, close) > 6 days ago daily max(90,close)] 

This yields the following hits;
SP500,  163
SP400,  113
SP600,  111
Total =  387

Now we also have another option if we wanted to look at the Large, Mid and Small caps simultaneously, we could create a grouped "OR" clause, enclosed by an extra set of square brackets.  Note this function is only available in the advanced scan engine interface and I have turned OFF the individual clauses.  (Note the S&P-1500 is currently not available in the scan engine as a predefined group, but you can chart it under the symbol $SPSUPX)

[type = stock]
// and [group is SP500]
// and [group is SP400]
// and [group is SP600]
and [ [group is SP500] or [group is SP400] or [group is SP600] ] 
and [max(5, close) > 6 days ago daily max(90,close)] 

This gives us the same 387 hits as the individual scans.

Now if we look at the $SPXEW-500 Equal Weight index, we see that it is about 1% above its recent highs, so lets limit our scan to only stocks which significantly exceed that.  Lets try 5% above the past highs and lets use the S&P-1500 group, (use the multiplier function).

[type = stock]
//and [group is SP500]
//and [group is SP400]
//and [group is SP600]
and [[group is SP500] or [group is SP400] or [group is SP600]]
and [max(5, close) > 6 days ago daily max(90,close) * 1.05

This gives us 45 hits.

In summary I verify each section (clause) before proceeding to the next clause.  I find the quickest way is to review 10-20 charts to see if they meet the scan criteria and I try to make this as visual as possible, (its just quicker).  So before I run the scan I set up a simple chart for only the time frame of the scan and only plot what the scan is looking for.  In this case the chart covers Feb till now and is a performance type chart which makes the min 5% gain easy to see.  I save this chart as my default style and after I run my scan I can easily dump the output into my "00 Temp" fav list (it’s the first list so its already in the drop down box, just hit go) and all the charts will be created with this chart style. 

Note; if for some reason you need to keep your default chart style you can also change the chart style after you have dumped the group to a new fav list, just set up a new style on one of the charts and then use the "Apply Style to All" button, but this will take a few more steps and you will have to redo those steps every time you run and dump new scan results.

1 output

At this point you can also click on the table headers and sort by "Sector" or "Industry" to see where most of the hits are coming from.

Then select the 10 per page view and quickly scroll thru 10-20 charts to verify the scan is finding what you asked for, or what you thought you asked for.   If necessary go back and modify the coding.  Then select differnt indexes or add more specific technical criteria.

2 output

The following is a graphical representation of the scan which is often helpful when developing and laying out scans, especially the more complicated ones.

Scan graphic

I hope this discussion has given you some new ideas on creating, modifying and testing your own customs scans.

Happy scanning,


(note: I don't work for StockCharts, I'm just a long time user always trying to learn more and willing to share what I've already learned.  If you have comments related to this article I'll try to answer them here, if you have other comments or suggestions send them directly to StockCharts thru the support page). .


Is It Possible to Change the Default Scan Definitions?


Right now, whenever I open up the Advanced Scan Workbench, I get this default benchmark definition for the universe of securities to scan:

[type = stock] and [daily sma(20,daily volume) > 40000]

This is hopelessly broad in that it includes boatloads of thinly traded stocks, penny stocks, foreign stocks and the like — securities I would never trade in, myself. I have my own definition of a securities universe, which looks like this:

[type = stock] and [[exchange is NYSE] or [exchange is AMEX] or
[exchange is NASDAQ]] and [daily sma(50,daily volume) > 200000] and [Close > 10]

This is my personal universe, and it works for me, but the point is, I would like to change the default securities universe to be that, rather than forcing me to manually change the overly broad universe that's already baked in, every time I log in.

Is there a way to make that change?



The short answer is “No.” The default scan page isn't customizable.

However, there is a workaround. You just have to change how you access the scan engine. Normally, I use the links on the Members page. You can use the right-hand link to “Create a New Scan,” which takes you to the Standard Scan Workbench. Then you hit the Advanced Scan button to get to the Advanced Scan Workbench page with the standard default starting point.

There is another link on the left, though, that you can use to pull up one of your saved scans and run it or edit it. This is the method I use, as I am either running a saved scan, editing a saved scan, or creating a new scan from scratch. Why not have the scan engine open directly in the scan where you want it to be, rather than open the default and then pull up your saved scan?

For a new scan with “MY Standard Default” intro settings, I just pull up one of my standard intro templates. These are scans I've created with different default settings that I use as a starting points. Their names start with “0” so they are always at the top of the drop-down menu list.


One more thing, its always good to put the primary database criteria first — Symbol, Open, High, Low, Close and Volume — and put the secondary calculated criteria second. Your scans will run faster if the heavy calculations are done after the universe of stocks has already been reduced.

In other words, don't ask the scan engine to calculate EMAs, Stochastics, and Bollinger data on the entire 30,000 stocks in the database, and then ask it to scan the results for stocks between $5 and $10. Make the pool of stocks to be scanned as small as possible first. Then, run the heavy calculations. Your scans will run much, much faster.

Cheers Gord


How to Use the Elder Impulse System to Trade


To experienced users of the Elder Impulse system for trading: What parameters for entering and exiting a trade have you found most useful using this system. For example do you exit a trade immediately when the daily 13 day ema chart shows a change from a green price flag to a blue, or do you wait until a red price flag is generated or what?



Before choosing chart settings, if you are an Elder follower, you will need your “Triple Screen.” I would suggest starting with hourly, daily and weekly. Personally, I just work from a feel for each chart. For my own trades, technically, I rely more on patterns, drawn lines, and fib level responses to price action (than the signals on the Elder Impulse). I saw a comment once from Elder that he uses 13, 65 and 200 EMA's, so I have been using that as a default chart for myself. Here is an example:



If there is a clear trend, then I favor ADX. If there is not, then I favor an oscillator like RSI. When I place indicators on the chart, I usually shift the setting towards fibonacci numbers (3, 5, 8, 13, 21, 34, 55, etc). For example, on the chart I posted above, the ADX trend is down and the RSI reading is still bearish. However, what is more impressive to me is that second Head and Shoulders pattern developing within the bearish flag and the confirmation of the bearish flag this last week. The next level to watch is the 2011 low near 10604 (kind of like an upside down break out) and then an A = C measured extension on a weekly chart. Here is the A = C extension on a weekly.


Notice that the daily (your primary trading time frame) and weekly (your big picture) charts work together using the Elder-suggested Triple Screen. All you would need to do is form an hourly chart (e.g., your entry) for your trade. Most all of this is discussed in Elder's book, Come Into My Trading Room. However, he does not discuss patterns very much in that book.


Other StockCharts Blogs

Subscribe to this blog