#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Options

# Bollinger band tight range

Hi,

I'm looking for a tight range Bollinger band squeeze or just a flat consolidation between 8-14 days.

Best Regards,
Max.

• Options
mod
edited April 2019

see the very bottom of the page

You could also try the min( ) and max( ) functions to specify a range over some number of days. You can search Help for how to use min( ) and max(). If your run into a problem, post what you have.
• Options
[type = stock] AND [Daily SMA(20,Daily Volume) > 40000]

and [BB Width(20,2) < 6] Here I want the last 15 days to be below 6
and [country is US]
and [volume > 200,000]
• Options
mod
edited April 2019
If you order it this way, it will run faster:

[country is US]
and [type = stock]
and [Daily SMA(20,Daily Volume) > 40000]
and [volume > 200,000]
and [BB Width(20,2) < 6]

You want to put the BBWidth indicator inside the max( ) function.

The max( ) function is documented here:

https://stockcharts.com/docs/doku.php?id=scans:functions

The first term inside the parens is the look back period (for you, 15). The second term is the value to look at - for your BB Width(20,2).

Some of its uses and coding examples are here:

• Options
thanks a lot here is the scan :
[country is US]
and [type = stock]
and [Daily SMA(20,Daily Volume) > 40000]
and [volume > 200,000]
and [max(30,BB Width(20,2)) < 6]
and [group is not ETF]
• Options
mod
Looks good. I would re-order it this way - always putting the descriptive things first (country, type, group, list, etc.) and the calculations last. And if you are really into it, simplest calculations first, then the more complicated. Not required, but more efficient for the scan engine and easier to read and edit when there is a problem or you want to make changes.

[country is US]
and [type = stock]
and [group is not ETF]
and [Daily SMA(20,Daily Volume) > 40000]
and [volume > 200,000]
and [max(30,BB Width(20,2)) < 6]