aurelia0001
New member
Hi,
I am using a script which displays a number of labels on an indicator line using addchart, see pseudo code below.
If none of the conditions apply the label should not display.
As the conditions are quite extensive I rather not use all the conditions over again in the (first) time condition, but rather at the end of the color assignment if-then-else exit use something like a double.nan - but thinkscript does not allow this.
I can't seem to come up with a clever alternative, any suggestions how to deal with this?
I am using a script which displays a number of labels on an indicator line using addchart, see pseudo code below.
If none of the conditions apply the label should not display.
As the conditions are quite extensive I rather not use all the conditions over again in the (first) time condition, but rather at the end of the color assignment if-then-else exit use something like a double.nan - but thinkscript does not allow this.
I can't seem to come up with a clever alternative, any suggestions how to deal with this?
JavaScript:
AddChartBubble(
yes
, baseline
, " label text "
, if cond1 then color1
else if cond2 then color2
else if etc. etc. (8 conditions in total)
else # do not show chartbubble / double.nan does not work
, yes);