Here’s a simple thinkscript that shows you how a stock or market does when it gaps higher above the Bollinger Band.
#Gap above 2nd BB
input price = close;
input displace = 0;
input length = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;
def Setup;
def sDev = stdev(data = price[-displace], length = length);
def MidLine = Average(data = price[-displace], length = length);
def LowerBand = MidLine + num_Dev_Dn * sDev;
def UpperBand = MidLine + num_Dev_Up * sDev;
if (open > close[1]) and (open > UpperBand ) {
Setup = 1;
} else {
Setup = 0;
}
plot signal = Setup;
signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Here’s what the chart looks like on the SPY: