Have not seen this code on the site, I watched John Carter using these bands to restrict his trades. The code is based on the TOS Keltner Channel code. I think it has good value in trading levels. It's basically 6 keltner channels with std deviation of 1,2,3,-1,-2,-3
Rich (BB code):
# Indicator that presents ATR 1,2,3 above and below using Keltner channel formula
input displace = 0;
input factor1 = 1.0;
input factor2 = 2.0;
input factor3 = 3.0;
input length = 21;
input price = close;
input averageType = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;
def shift1 = factor1 * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def shift2 = factor2 * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def shift3 = factor3 * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
plot average = MovingAverage(averageType, price, length);
average.SetDefaultColor(GetColor(4));
plot Upper_Band1 = average[-displace] + shift1[-displace];
Upper_Band1 .SetDefaultColor(GetColor(6));
plot Upper_Band2 = average[-displace] + shift2[-displace];
Upper_Band2 .SetDefaultColor(GetColor(0));
plot Upper_Band3 = average[-displace] + shift3[-displace];
Upper_Band3.SetDefaultColor(GetColor(5));
plot Lower_Band1 = average[-displace] - shift1[-displace];
Lower_Band1 .SetDefaultColor(GetColor(6));
plot Lower_Band2 = average[-displace] - shift2[-displace];
Lower_Band2 .SetDefaultColor(GetColor(0));
plot Lower_Band3 = average[-displace] - shift3[-displace];
Lower_Band3.SetDefaultColor(GetColor(5));