InvestorsHub Logo
Followers 11
Posts 2529
Boards Moderated 1
Alias Born 04/03/2009

Re: alexed post# 993

Wednesday, 03/07/2012 10:21:27 AM

Wednesday, March 07, 2012 10:21:27 AM

Post# of 3631
I'm glad it works for you! Here's light grey so you can see how I changed the code. I really like this color :) You can also change the color of the bands if you want to in the properties section of the study (lower section.) (Just noticed you had left them the way I sent it so, just in case you don't know.)

#####

input price = close;
input displace = 0;
input length = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;

def sDev = stdev(data = price[-displace], length = length);

plot MidLine = ExpAverage(data = price[-displace], length = length);
plot LowerBand = MidLine + num_Dev_Dn * sDev;
plot UpperBand = MidLine + num_Dev_Up * sDev;

LowerBand.SetDefaultColor(GetColor(1));
MidLine.SetDefaultColor(GetColor(1));
UpperBand.SetDefaultColor(GetColor(1));

AddCloud(LowerBand, UpperBand, color.RED, color.LIGHT_GRAY);

#####

See color selection here:

http://tda.thinkorswim.com/manual/dark/thinkscript/reference/Constants/Color/Color.LIGHT_GRAY.html

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.