InvestorsHub Logo
icon url

spdpro

01/07/12 11:25 PM

#60170 RE: gloe #60168

Gloe > yes it can be done starting with something like this
then do the color change code to what ever parameters, I have
no interest in doing that but if you want BB's you might want
to save this one

==========================================================

#
# SJ_EMATrippleBollinger
#
input Price = close;
input Displace = 0;
input Length = 20;
input Deviation1 = 1.0;
input Deviation2 = 2.0;
input Deviation3 = 3.0;
#
def sDev = stdev(data = Price[-Displace], Length = Length);
#
plot MidLine = ExpAverage(data = Price[-Displace], Length = Length);
#
plot UpperBand1 = MidLine + Deviation1 * sDev;
plot UpperBand2 = MidLine + Deviation2 * sDev;
plot UpperBand3 = MidLine + Deviation3 * sDev;
plot LowerBand3 = MidLine - Deviation3 * sDev;
plot LowerBand2 = MidLine - Deviation2 * sDev;
plot LowerBand1 = MidLine - Deviation1 * sDev;
#
MidLine.SetDefaultColor(GetColor(9));
UpperBand1.SetDefaultColor(GetColor(0));
UpperBand2.SetDefaultColor(GetColor(4));
UpperBand3.SetDefaultColor(GetColor(5));
LowerBand3.SetDefaultColor(GetColor(5));
LowerBand2.SetDefaultColor(GetColor(4));
LowerBand1.SetDefaultColor(GetColor(0));