Question about AssignPriceColor ?

mbarcala

Active member
I have a little situation here assigning a color on the price and for some reason I haven't be able to see what I doing wrong. Here is part of my code to see if someone can help me to understand where I'm stuck

I working with a Bollinger bands
Code:
input length = 20;
input colorType = {default "CrossMa", "ovBands"};

plot midBand = ExpAverage(close, length);

def dcUp = if close[1] crosses below midBand and close crosses above midBand or close crosses above midBand then 1 else 0;
def dcDn = if close[1] crosses above midBand and close crosses below midBand or close crosses below midBand then 1 else 0;

def ovUpBands = if close > UpBand1s or high > UpBand1s then 1 else 0;
def ovDnBands = if close < DnBand1s or low < DnBand1s then 1 else 0;

## Dots Direction ##
def viUpDn = if dcUp or dcDn then 1 else if viUpDn[1] == 1 and dcUp or dcDn then 1 else 0;

def debug = yes;
plot x = if !debug then Double.NAN else viUpDn;
x.Hide();

DefineGlobalColor("Blue", CreateColor(0,101,255));
DefineGlobalColor("dGray", CreateColor(50,50,50));
DefineGlobalColor("Burg", CreateColor(230,17,125));

def UpView;
def DnView;
plot diDots;
def ovUpBand;
def ovDnBand;

switch (colorType) {
case "CrossMA":
    UpView = dcUp;
    DnView = dcDn;
    diDots = if UpView and viUpDn[-1] == 0 then plow else
             if DnView and viUpDn[-1] == 0 then phigh else Double.NaN;
    ovUpBand = Double.NaN;
    ovDnBand = Double.NaN;
case "ovBands":
    UpView = Double.NaN;
    DnView = Double.NaN;
    diDots = Double.NaN;
    ovUpBand = ovUpBands;
    ovDnBand = ovDnBands;
}

diDots.SetDefaultColor(GlobalColor("Burg"));
diDots.SetStyle(Curve.POINTS);
diDots.SetLineWeight(2);
diDots.HideTitle();
diDots.HideBubble();

AssignPriceColor(if UpView or DnView then GlobalColor("Blue") else
                 if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray"));

What I trying to do is that in one option I paint the bars only when the price cross the 20EMA only and the rest gray and in the second option I just want to paint the bars when they goes over the bands in my Bollinger bands and the rest gray

any idea what I'm missing here?
 
Solution
I have a little situation here assigning a color on the price and for some reason I haven't be able to see what I doing wrong. Here is part of my code to see if someone can help me to understand where I'm stuck

I working with a Bollinger bands
Code:
input length = 20;
input colorType = {default "CrossMa", "ovBands"};

plot midBand = ExpAverage(close, length);

def dcUp = if close[1] crosses below midBand and close crosses above midBand or close crosses above midBand then 1 else 0;
def dcDn = if close[1] crosses above midBand and close crosses below midBand or close crosses below midBand then 1 else 0;

def ovUpBands = if close > UpBand1s or high > UpBand1s then 1 else 0;
def ovDnBands = if close < DnBand1s or low < DnBand1s then 1...
I have a little situation here assigning a color on the price and for some reason I haven't be able to see what I doing wrong. Here is part of my code to see if someone can help me to understand where I'm stuck

I working with a Bollinger bands
Code:
input length = 20;
input colorType = {default "CrossMa", "ovBands"};

plot midBand = ExpAverage(close, length);

def dcUp = if close[1] crosses below midBand and close crosses above midBand or close crosses above midBand then 1 else 0;
def dcDn = if close[1] crosses above midBand and close crosses below midBand or close crosses below midBand then 1 else 0;

def ovUpBands = if close > UpBand1s or high > UpBand1s then 1 else 0;
def ovDnBands = if close < DnBand1s or low < DnBand1s then 1 else 0;

## Dots Direction ##
def viUpDn = if dcUp or dcDn then 1 else if viUpDn[1] == 1 and dcUp or dcDn then 1 else 0;

def debug = yes;
plot x = if !debug then Double.NAN else viUpDn;
x.Hide();

DefineGlobalColor("Blue", CreateColor(0,101,255));
DefineGlobalColor("dGray", CreateColor(50,50,50));
DefineGlobalColor("Burg", CreateColor(230,17,125));

def UpView;
def DnView;
plot diDots;
def ovUpBand;
def ovDnBand;

switch (colorType) {
case "CrossMA":
    UpView = dcUp;
    DnView = dcDn;
    diDots = if UpView and viUpDn[-1] == 0 then plow else
             if DnView and viUpDn[-1] == 0 then phigh else Double.NaN;
    ovUpBand = Double.NaN;
    ovDnBand = Double.NaN;
case "ovBands":
    UpView = Double.NaN;
    DnView = Double.NaN;
    diDots = Double.NaN;
    ovUpBand = ovUpBands;
    ovDnBand = ovDnBands;
}

diDots.SetDefaultColor(GlobalColor("Burg"));
diDots.SetStyle(Curve.POINTS);
diDots.SetLineWeight(2);
diDots.HideTitle();
diDots.HideBubble();

AssignPriceColor(if UpView or DnView then GlobalColor("Blue") else
                 if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray"));

What I trying to do is that in one option I paint the bars only when the price cross the 20EMA only and the rest gray and in the second option I just want to paint the bars when they goes over the bands in my Bollinger bands and the rest gray

any idea what I'm missing here?

Since you did not provide the followning in your code UpBand1s, DnBand1s, plow and phigh, I substituted some similar values to be able to test the price color code. This seems to be doing what you stated you wanted your colors to be.

Capture.jpg
Ruby:
input length = 20;
input colorType = {default "CrossMa", "ovBands"};

plot midBand = ExpAverage(close, length);
######################################################
plot upband1s= reference BollingerBands().UpperBand;
plot dnband1s = reference BollingerBands().LowerBand;
#######################################################

def dcUp = if close[1] crosses below midBand and close crosses above midBand or close crosses above midBand then 1 else 0;
def dcDn = if close[1] crosses above midBand and close crosses below midBand or close crosses below midBand then 1 else 0;

def ovUpBands = if close > UpBand1s or high > UpBand1s then 1 else 0;
def ovDnBands = if close < DnBand1s or low < DnBand1s then 1 else 0;

## Dots Direction ##
def viUpDn = if dcUp or dcDn then 1 else if viUpDn[1] == 1 and dcUp or dcDn then 1 else 0;

def debug = yes;
plot x = if !debug then Double.NAN else viUpDn;
x.Hide();

DefineGlobalColor("Blue", CreateColor(0,101,255));
DefineGlobalColor("dGray", CreateColor(50,50,50));
DefineGlobalColor("Burg", CreateColor(230,17,125));

def UpView;
def DnView;
plot diDots;
def ovUpBand;
def ovDnBand;

switch (colorType) {
case "CrossMA":
    UpView = dcUp;
    DnView = dcDn;
################ plow/phigh not defined so substituted loww/high to test color code
    diDots = if UpView and viUpDn[-1] == 0 then low else
             if DnView and viUpDn[-1] == 0 then high else Double.NaN;
    ovUpBand = Double.NaN;
    ovDnBand = Double.NaN;
case "ovBands":
    UpView = Double.NaN;
    DnView = Double.NaN;
    diDots = Double.NaN;
    ovUpBand = ovUpBands;
    ovDnBand = ovDnBands;
}

diDots.SetDefaultColor(GlobalColor("Burg"));
diDots.SetStyle(Curve.POINTS);
diDots.SetLineWeight(2);
diDots.HideTitle();
diDots.HideBubble();

AssignPriceColor(if colortype==colortype."CrossMA" then if UpView or DnView then GlobalColor("Blue") else GlobalColor("dGray") else
                 if colortype==colortype."ovBands" then if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray") else color.current);
 
Solution
Since you did not provide the followning in your code UpBand1s, DnBand1s, plow and phigh, I substituted some similar values to be able to test the price color code. This seems to be doing what you stated you wanted your colors to be.
As alway SleepyZ thank you for the good help!

This part here make my code work complete well
Code:
AssignPriceColor(if colortype==colortype."CrossMA" then if UpView or DnView then GlobalColor("Blue") else GlobalColor("dGray") else
                 if colortype==colortype."ovBands" then if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray") else color.current);
 
Last edited:
As alway SleepyZ thank you for the good help!

This part here make my code work complete well
Code:
AssignPriceColor(if colortype==colortype."CrossMA" then if UpView or DnView then GlobalColor("Blue") else GlobalColor("dGray") else
                 if colortype==colortype."ovBands" then if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray") else color.current);
Since you did not provide the followning in your code UpBand1s, DnBand1s, plow and phigh, I substituted some similar values to be able to test the price color code. This seems to be doing what you stated you wanted your colors to be.
Here is the final code that I was trying to put together and with your help was possible!
https://usethinkscript.com/threads/dbands-upper-indicator-for-thinkorswim.12415/
 
Since you did not provide the followning in your code UpBand1s, DnBand1s, plow and phigh, I substituted some similar values to be able to test the price color code. This seems to be doing what you stated you wanted your colors to be.
Hi SleepyZ, I run into another issue adding a label. I using two band in my script (Band1 and Band2) and the label work find but only when I show two Bands visible on the chart it work ok but if I choose to show only one Band then the label does show up. Any idea how I can correct this?

Code:
input length = 20;
input lDev = 2.0;
input showBand = yes;
input hDev = 2.6;
input bandType = {default "Bollinger", "Keltner"};

def sDev = stdev(close, length);
def shift1 = lDev * ExpAverage(TrueRange(high, close, low), length);
def shift2 = hDev * ExpAverage(TrueRange(high, close, low), length);

plot UpBand1;
plot DnBand1;
plot UpBand2;
plot DnBand2;
switch (bandType) {
case "Bollinger":
    UpBand1 = if showBand then midBand + lDev * sDev else Double.NaN;
    DnBand1 = if showBand then midBand - lDev * sDev else Double.NaN;
    UpBand2 = midBand + hDev * sDev;
    DnBand2 = midBand - hDev * sDev;
case "Keltner":
    UpBand1 = if showBand then midBand + shift1 else Double.NaN;
    DnBand1 = if showBand then midband - shift1 else Double.NaN;
    UpBand2 = midBand + shift2;
    DnBand2 = midband - shift2;
}

#UpperBand and LowerBand Labels
def cond1 = close > UpBand1 or close < UpBand2;
def cond2 = close < DnBand1 or close > DnBand2;
def cond3 = close > UpBand2;
def cond4 = close < DnBand2;
def cond5 = close < UpBand1 or close > DnBand1;

AddLabel(yes, if cond1 then " UpperBand: " + lDev + " " else
        if cond2 then " LowerBand: " + -lDev + " " else
        if cond3 then " UpperBand: " + hDev + " " else
        if cond4 then " LowerBand: " + -hDev + " " else
        if cond5 then " LevelBand: " + " N/A " else "",
        if cond1 then Color.DARK_RED else
        if cond3 then Color.RED else
        if cond2 then Color.DARK_GREEN else
        if cond4 then Color.GREEN else
        if cond5 then Color.GRAY else Color.CURRENT);
 
Last edited:
Hi SleepyZ, I run into another issue adding a label. I using two band in my script (Band1 and Band2) and the label work find but only when I show the two Bands visible on the chart but if I choose to hide one the label does show up. Any idea how I can correct this?

Code:
input lDev = 2.0;
input showBand = yes;
input hDev = 2.6;
input bandType = {default "Bollinger", "Keltner"};

plot UpBand1;
plot DnBand1;
plot UpBand2;
plot DnBand2;
switch (bandType) {
case "Bollinger":
    UpBand1 = if showBand then midBand + lDev * sDev else Double.NaN;
    DnBand1 = if showBand then midBand - lDev * sDev else Double.NaN;
    UpBand2 = midBand + hDev * sDev;
    DnBand2 = midBand - hDev * sDev;
case "Keltner":
    UpBand1 = if showBand then midBand + shift1 else Double.NaN;
    DnBand1 = if showBand then midband - shift1 else Double.NaN;
    UpBand2 = midBand + shift2;
    DnBand2 = midband - shift2;
}

#UpperBand and LowerBand Labels
def cond1 = close > UpBand1 or close < UpBand2;
def cond2 = close < DnBand1 or close > DnBand2;
def cond3 = close > UpBand2;
def cond4 = close < DnBand2;
def cond5 = close < UpBand1 or close > DnBand1;

AddLabel(yes, if cond1 then " UpperBand: " + lDev + " " else
        if cond2 then " LowerBand: " + -lDev + " " else
        if cond3 then " UpperBand: " + hDev + " " else
        if cond4 then " LowerBand: " + -hDev + " " else
        if cond5 then " LevelBand: " + " N/A " else "",
        if cond1 then Color.DARK_RED else
        if cond3 then Color.RED else
        if cond2 then Color.DARK_GREEN else
        if cond4 then Color.GREEN else
        if cond5 then Color.GRAY else Color.CURRENT);
not sure if this what you mean

CSS:
input lDev = 2.0;
input BBBand = yes;
input KCBand = yes;
input hDev = 2.6;
input bandType = {default "Bollinger", "Keltner"};

plot UpBand1;
plot DnBand1;
plot UpBand2;
plot DnBand2;
switch (bandType) {
case "Bollinger":
    UpBand1 = if BBBand then midBand + lDev * 1 else Double.NaN;
    DnBand1 = if BBBand then midBand - lDev * 1 else Double.NaN;
    UpBand2 = midBand + hDev * 1;
    DnBand2 = midBand - hDev * 1;
case "Keltner":
    UpBand1 = if KCBand then midBand + 2 else Double.NaN;
    DnBand1 = if KCBand then midband - 2 else Double.NaN;
    UpBand2 = midBand + 3;
    DnBand2 = midband - 3;
}
#UpperBand and LowerBand Labels
def cond1 =(close > UpBand1) or (close < UpBand2);
def cond2 = (close < DnBand1) or (close > DnBand2);
def cond3 = close > UpBand2;
def cond4 = close < DnBand2;
def cond5 = (close < UpBand1) or (close > DnBand1);

AddLabel(yes, if cond1 then " UpperBand: " + lDev + " " else
        if cond2 then " LowerBand: " + -lDev + " " else
        if cond3 then " UpperBand: " + hDev + " " else
        if cond4 then " LowerBand: " + -hDev + " " else
        if cond5 then " LevelBand: " + " N/A " else "",
        if cond1 then Color.DARK_RED else
        if cond3 then Color.RED else
        if cond2 then Color.DARK_GREEN else
        if cond4 then Color.GREEN else
        if cond5 then Color.GRAY else Color.CURRENT);
 
not sure if this what you mean

CSS:
input lDev = 2.0;
input BBBand = yes;
input KCBand = yes;
input hDev = 2.6;
input bandType = {default "Bollinger", "Keltner"};

plot UpBand1;
plot DnBand1;
plot UpBand2;
plot DnBand2;
switch (bandType) {
case "Bollinger":
    UpBand1 = if BBBand then midBand + lDev * 1 else Double.NaN;
    DnBand1 = if BBBand then midBand - lDev * 1 else Double.NaN;
    UpBand2 = midBand + hDev * 1;
    DnBand2 = midBand - hDev * 1;
case "Keltner":
    UpBand1 = if KCBand then midBand + 2 else Double.NaN;
    DnBand1 = if KCBand then midband - 2 else Double.NaN;
    UpBand2 = midBand + 3;
    DnBand2 = midband - 3;
}
#UpperBand and LowerBand Labels
def cond1 =(close > UpBand1) or (close < UpBand2);
def cond2 = (close < DnBand1) or (close > DnBand2);
def cond3 = close > UpBand2;
def cond4 = close < DnBand2;
def cond5 = (close < UpBand1) or (close > DnBand1);

AddLabel(yes, if cond1 then " UpperBand: " + lDev + " " else
        if cond2 then " LowerBand: " + -lDev + " " else
        if cond3 then " UpperBand: " + hDev + " " else
        if cond4 then " LowerBand: " + -hDev + " " else
        if cond5 then " LevelBand: " + " N/A " else "",
        if cond1 then Color.DARK_RED else
        if cond3 then Color.RED else
        if cond2 then Color.DARK_GREEN else
        if cond4 then Color.GREEN else
        if cond5 then Color.GRAY else Color.CURRENT);
did not work either. I forgot to include the stdev sorry

Code:
def sDev = stdev(close, length);
 
did not work either. I forgot to include the stdev sorry

Code:
def sDev = stdev(close, length);

See if removing the showbands in the def statements for Upband1 and DnBand1 and adding sethiding(showband). Here is your final code with those adjustments and the label included. When showbands is yes or no your lables still appear.

Ruby:
# Double Bands by mbarcala for thinkorswim

input length = 20;
input lDev = 2.0;
input showBand = yes;
input hDev = 2.6;
input maType = {default "Exponential", "Simple", "Wilders", "Weighted"};
input bandType = {default "Bollinger", "Keltner"};
input colorType = {default "CrossMa", "ovBands"};

def sDev = StDev(close, length);
def shift1 = lDev * ExpAverage(TrueRange(high, close, low), length);
def shift2 = hDev * ExpAverage(TrueRange(high, close, low), length);

plot midBand;
switch (maType) {
case "Exponential":
    midBand = ExpAverage(close, length);
case "Simple":
    midBand = SimpleMovingAvg(close, length);
case "Wilders":
    midBand = WildersAverage(close, length);
case "Weighted":
    midBand = WMA(close, length);
}

plot UpBand1;
plot DnBand1;
plot UpBand2;
plot DnBand2;
switch (bandType) {
case "Bollinger":
    UpBand1 = midBand + lDev * sDev;
    DnBand1 = midBand - lDev * sDev;
    UpBand2 = midBand + hDev * sDev;
    DnBand2 = midBand - hDev * sDev;
case "Keltner":
    UpBand1 = midBand + shift1;
    DnBand1 = midBand - shift1;
    UpBand2 = midBand + shift2;
    DnBand2 = midBand - shift2;
}

DefineGlobalColor("Blue", CreateColor(0, 101, 255));
DefineGlobalColor("dGray", CreateColor(50, 50, 50));
DefineGlobalColor("Burg", CreateColor(230, 17, 125));

midBand.SetDefaultColor(Color.GRAY);
midBand.SetLineWeight(3);
midBand.HideTitle();

UpBand1.SetDefaultColor(GlobalColor("dGray"));
UpBand1.SetStyle(Curve.LONG_DASH);
UpBand1.HideBubble();
UpBand1.HideTitle();
UpBand1.SetHiding(showBand);
UpBand2.SetDefaultColor(GlobalColor("dGray"));
UpBand2.SetStyle(Curve.LONG_DASH);
UpBand2.HideBubble();
UpBand2.HideTitle();


DnBand1.SetDefaultColor(GlobalColor("dGray"));
DnBand1.SetStyle(Curve.LONG_DASH);
DnBand1.HideBubble();
DnBand1.HideTitle();
DnBand1.SetHiding(showBand);
DnBand2.SetDefaultColor(GlobalColor("dGray"));
DnBand2.SetStyle(Curve.LONG_DASH);
DnBand2.HideBubble();
DnBand2.HideTitle();


def prange = high - low;
def phigh = high + prange * .2;
def plow = low - prange * .2;

#Bands2
plot obHighLow = if close > UpBand2 or high > UpBand2 then phigh else
                 if close < DnBand2 or low < DnBand2 then plow else Double.NaN;
obHighLow.SetStyle(Curve.POINTS);
obHighLow.SetDefaultColor(Color.BLACK);
obHighLow.SetLineWeight(1);
obHighLow.HideTitle();
obHighLow.HideBubble();

plot obHighLowbg = if close > UpBand2 or high > UpBand2 then phigh else
                   if close < DnBand2 or low < DnBand2 then plow else Double.NaN;
obHighLowbg.SetStyle(Curve.POINTS);
obHighLowbg.SetLineWeight(5);
obHighLowbg.AssignValueColor(if close > UpBand2 or high > UpBand2 then Color.RED else Color.GREEN);
obHighLowbg.HideTitle();
obHighLowbg.HideBubble();

def obpHLsq = if close > UpBand1 or high > UpBand1 then phigh else Double.NaN;
def obnHLsq = if close < DnBand1 or low < DnBand1 then plow else Double.NaN;

plot obsHigh = if showBand then if obpHLsq then phigh else Double.NaN else Double.NaN;
obsHigh.SetPaintingStrategy(PaintingStrategy.SQUARES);
obsHigh.SetLineWeight(1);
obsHigh.SetDefaultColor(Color.RED);
obsHigh.HideTitle();
obsHigh.HideBubble();

plot obsLow = if showBand then if obnHLsq then plow else Double.NaN else Double.NaN;
obsLow.SetPaintingStrategy(PaintingStrategy.SQUARES);
obsLow.SetLineWeight(1);
obsLow.SetDefaultColor(Color.GREEN);
obsLow.HideTitle();
obsLow.HideBubble();

def dcUp = if close[1] crosses below midBand and close crosses above midBand or close crosses above midBand then 1 else 0;
def dcDn = if close[1] crosses above midBand and close crosses below midBand or close crosses below midBand then 1 else 0;

def ovUpBands = if close > UpBand1 or high > UpBand1 then 1 else 0;
def ovDnBands = if close < DnBand1 or low < DnBand1 then 1 else 0;

## Dots Direction ##
def viUpDn = if dcUp or dcDn then 1 else if viUpDn[1] == 1 and dcUp or dcDn then 1 else 0;

def debug = yes;
plot x = if !debug then Double.NaN else viUpDn;
x.Hide();

def UpView;
def DnView;
plot diDots;
def ovUpBand;
def ovDnBand;

switch (colorType) {
case "CrossMa":
    UpView = dcUp;
    DnView = dcDn;
    diDots = if UpView and viUpDn[-1] == 0 then plow else
             if DnView and viUpDn[-1] == 0 then phigh else Double.NaN;
    ovUpBand = Double.NaN;
    ovDnBand = Double.NaN;
case "ovBands":
    UpView = Double.NaN;
    DnView = Double.NaN;
    diDots = Double.NaN;
    ovUpBand = ovUpBands;
    ovDnBand = ovDnBands;
}

diDots.SetDefaultColor(GlobalColor("Burg"));
diDots.SetStyle(Curve.POINTS);
diDots.SetLineWeight(2);
diDots.HideTitle();
diDots.HideBubble();

AssignPriceColor(if colorType == colorType."CrossMa" then if UpView or DnView then GlobalColor("Blue") else GlobalColor("dGray") else
                 if colorType == colorType."ovBands" then if ovUpBand or ovDnBand then GlobalColor("Blue") else GlobalColor("dGray") else Color.CURRENT);

#UpperBand and LowerBand Labels
def cond1 = close > UpBand1 or close < UpBand2;
def cond2 = close < DnBand1 or close > DnBand2;
def cond3 = close > UpBand2;
def cond4 = close < DnBand2;
def cond5 = close < UpBand1 or close > DnBand1;

AddLabel(yes, if cond1 then " UpperBand: " + lDev + " " else
        if cond2 then " LowerBand: " + -lDev + " " else
        if cond3 then " UpperBand: " + hDev + " " else
        if cond4 then " LowerBand: " + -hDev + " " else
        if cond5 then " LevelBand: " + " N/A " else "",
        if cond1 then Color.DARK_RED else
        if cond3 then Color.RED else
        if cond2 then Color.DARK_GREEN else
        if cond4 then Color.GREEN else
        if cond5 then Color.GRAY else Color.CURRENT);
 
See if removing the showbands in the def statements for Upband1 and DnBand1 and adding sethiding(showband). Here is your final code with those adjustments and the label included. When showbands is yes or no your lables still appear.
yes, if I remove the showBands or if I select to show me the 2 bands all the time the labels work perfectly. why that option of showbands could affecting the label if I have one of the bands hide, in your opinion? or it should be wrote in a different way to avoid that?
 
yes, if I remove the showBands or if I select to show me the 2 bands all the time the labels work perfectly. why that option of showbands could affecting the label if I have one of the bands hide, in your opinion? or it should be wrote in a different way to avoid that?

Because when your showbands was no, it completely removed (double.nan) them and made cond2 and cond5 fail. Those conditions were part of the if statement that was looking for those bands and thus it failed the whole addlabel. What I showed you was that you could still use the input showbands yes or no and it will still show your label. The sethiding does just that it hides the plots but does not make the band values double.nan.
 
Last edited:
Because when your showbands was no, it completely removed (double.nan) them and made cond2 and cond5 fail. Those conditions were part of the if statement that was looking for those bands and thus it failed the whole addlabel. What I showed you was that you could still use the input showbands yes or no and it will still show your label. The sethiding does just that it hides the plots but does not make the band values double.nan.
Yes you complete right! thanks for help me to understand
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
261 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top