thinkscript

Can't call HideBubble within conditional statement


Good evening, all. I have a script where I would like to let the user choose whether to show the price bubbles on my plot. I've created an input parameter but it looks like you can't call the hide function inside an if block. The following seems straightforward but doesn't compile... any workarounds?

input hidePriceBubbles = no;
.
.
.
plot p_amLows = amLows;
p_amLows.SetStyle(Curve.POINTS);
p_amLows.SetDefaultColor(Color.YELLOW);

if hidePriceBubbles then {
    p_amLows.HideBubble();    <--- "can not be called within branching"
} else {
}

Solution

  • Newbie mistake on my part. I didn't realize that the ThinkOrSwim UI automatically provides a settings panel for every plot in a script. Among the choices on this panel is one that allows the user to hide the price bubble. No coding required... it is baked into the system.