Range Crossing Lower Bollinger


I’m attempting to create a script for the scanner that identifies any stock where the prior day’s price range crossed the lower Bollinger Band (21 bar, exponential), but closed above the lower Bollinger Band. I’m new to the scripts, so to begin, I used SHOWBAR to test what I was doing. The script I used to identify the cross, is as follows:

LOW() CrossesBelow BB(DEFAULT=LowerLine, BARS=21, STYLE=Exponential) – these are identified as green arrows in the image below

The script I used to identify the close, is as follows:

CLOSE() > BB(DEFAULT=LowerLine, BARS=21, STYLE=Exponential) – identified by the fuchsia arrows below

MRK_BB Script

As you can see above, the last black candle on the right does not indicate a green arrow, but the candle range from that day opened above, crossed below, and then closed above. The script for the "close above" SHOWBAR appears to work as expected. This is one example, but there are many, where it doesn’t quite make sense. By the way, the properties for the Bollingers on the chart above are identical to what is in the script (21 day, Exponential, Close).

Once I have this step correct, I’ll put it into a script with an OFFSET = 1 to scan for the prior day. At least, I think that’s the correct way to do it ?.

What am I doing wrong?


Hi Erik,

The reason the bar does not show a green arrow is because the previous candle was already below the low. Crosses below looks for a new instance of the Low() crossing the line, after the first instance is found, the Low must cross above the BB line before it can be triggered again.

If you want any instance where the Low is below the BB line, change the CrossesBelow in your script to a less than symbol <


Thanks Matthew.