New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

Scan for Narrow Range within the last month... or so.

If you look at GMAN, from Jan 27 to March 18, 2015, you see it was in a tight range, just before the breakout. Now, how do you scan for stocks in very tight (or narrow) range?

Can I use a Moving Avg with some sort of criteria for a range of not more than a certain percentage?

Then how do I add a length of time?
I don't want to find stocks that were in a narrow range for the past 3 days, but I am looking for a range that lasted for about a month or more.

What does the "range" used for?
[type = stock]
AND [country = US]
AND [Daily SMA(20,Daily Volume) > 40000]
AND [Range > 9.99]

Can I use that function (range) with a MA?

Thanks for any thoughts!


  • markdmarkd mod
    edited April 2015
    I think you could try something with price channels.

    Using the default value of 20, you would want the upper price channel higher than say 40 or 60 days ago, but flat (equal) compared to maybe 10 to maybe 15 days ago. That gets the rising but stalled character of the chart.

    Then you could test for the 5 day lower price channel greater than say five days ago and maybe 20 days ago, and the daily low above the lower price channel. That gets the narrowness.

    You might have to play with the numbers, but that's the idea. Unfortunately, stocks have a lot of variation in the way they set up. What looks similar to the eye will not pass the same tests on the computer. If you write the scan too specifically, you won't get many hits and good opportunities will be lost. If you write it too broadly you get a lot of things you didn't intend, so you spend extra time finding the situations you really want. So you need to adjust the scan until you get something in the middle.
  • Forgot to answer your question about range: range is the distance from the low of a single bar to it's high.

    You can test for an MA of range:

    and [sma(10, range) < some value]

    But some prefer to use use Average True Range (atr)

    and [atr(10) < some value]

    Those two statements are basically the same, except atr takes gaps from the prior close into account. So if today's low is greater than yesterday's close, atr would treat yesterday's close as the true low. If the high were lower than yesterday's close, the close would become the high.

    For your chart example, you might test for diminishing range or average true range:

    and [sma(10, range) < 10 days ago sma(10, range)]

    But again, the more tests you include the fewer hits you get, and so the more likely you could miss a good opportunity. So you wouldn't include it unless you definitely know it's part of the pattern that leads to the jumps you are looking for. (You might be interested in the NR7 pattern - narrowest range in last seven days - google it).
  • You could use something like this...It shows stocks where the 42 day high is no more than 10% higher than the 42 day low...You can change the days and/or the percentage and then add your other preferred criteria.

    [daily max(42,daily high) <= daily min(42,daily low) * 1.10]
  • markdmarkd mod
    edited April 2015
    @Sharptraders - that works really well. Allows for a lot of variation in pattern, but a minimum of non-conforming hits, especially as you shrink the per cent side. Thanks.
Sign In or Register to comment.