Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Pine Script weird bug

something weird is happening: this line

sb1_signal_color = sflag1 ? yellow : na

causes the price chart to disappear (the indicator panes are fine, the candles are gone)

BUT this line:

sb1_signal_color = sflag1 == true ? yellow : na

behaves properly and the plot color is indeed yellow! it's driving me nuts.

so i did one more test:

sflag1 = true (or sflag1 = 1)
sb1_signal_color = sflag1 ? yellow : na

causes no problem.

BUT

sflag1 = (sflag0 and (barssince(_cross(ema, sma) < 0) < 0) ? 1 : 0
sb1_signal_color = sflag1 == true ? yellow : na

also causes NO PROBLEM! obviously, the complex conditional returns 1, so sflag1 == 1 implies sflag1 == true BUT then why doesn't it work when sflag1 ? yellow : na ???

actually, i just tried something else:

sflag1 = 1
sb1_signal_color = sflag1 == true ? yellow : na

and execution goes to the 'else' branch (na)!

so 1 != true .

i had enough for one day. going to sleep.

Note: This topic was created from a reply on the Pine scripting language topic.
1 person has
this problem
+1
Reply