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.

How to scan for bollinger band and standard deviation breakouts

1)How would I scan for all stocks that broke the upper bollinger band or lower bollinger band?
2)How would I scan for all stocks that closed above/below 3 standard deviations of the price moment?

I wrote some simple scans, but I am not sure what keywords to use for above.
I am using following reference material for supported keywords. Is there a complete documentation on ALL supported keywords (for example, following link doesnt refer to keyword "uptrend", but this keyword is supported)
http://stockcharts.com/docs/doku.php?id=scans:advanced_scan_syntax

Thank you

Best Answer

  • markdmarkd mod
    edited February 2015 Answer ✓
    You can just do one scan, since the second parameter for Bollinger Bands is the number of standard deviations. The first is the number of days you want to look at to calculate the standard deviation. So on the chart, BB(20,2) would draw the upper and lower bands derived from two standard deviations for the last 20 day's price action. Change the 2 to 3 to get 3 standard deviations.

    To write the scan, use the "Technical Indicators" drop down on the advanced scan page. This gives you all available grammatically correct keywords. Select Upper BB, click insert, and modify the parameters.

    You want a breakout, so use the "cross above" operator "x". So close crosses above upper BB.

    For the lower BB, same thing, except the lower BB "crosses above" the close (not intuitive, but it's right if you think about it). I would do this in a separate scan to keep things simple. If you do both in one scan, you have to mess around with the "or" operator and group your conditions correctly with extra brackets. Leave that for later.

    Probably you should also think about limiting "all stocks" to some subset of all stocks. Otherwise you get hundreds of hits most days. You could use predefined groups (see the Sectors and Industries dropdown on the advanced scan page), or some other criteria, like close > 20 and close < 50, or market cap > 10000 or whatever. Check out the "Ticker Properties" and "Price, Volume and SCTRs" drop downs to pick and choose.

    As for "uptrend", you have to define this for your self. It's probably better that way because you have alot of flexibility. For instance, depending on your time frame, you could test for sma(200,close) > 21 days ago sma(200,close) i.e. a rising long term simple moving average is moving up. Maybe you might also want to test for a close above the 200MA. If you only care about the 50 or 10 day MA, change the test for rising averages accordingly, as you see fit.

Sign In or Register to comment.