0

On using ternary operator in Plotchar() , the true condition is not fully recognized (in spite of placing it in "()" brackets). Mismatched inpur error is given(refer image).
How to resolve this ?

Code:

k = ta.sma(...)
plotchar((k < 20) ? (xUp , "Go Long", "▲", location.bottom, color.lime, size = size.tiny) : na)

Image:

enter image description here

srt111
  • 1,079
  • 11
  • 20

1 Answers1

0

The ternary operator uses the series (xUp : na) only for conditionals,not the entire plotchar parameters.

k = ta.sma(...)
plotchar(k < 20 ? xUp: na , "Go Long", "▲", location.bottom, color.lime, size = size.tiny)
srt111
  • 1,079
  • 11
  • 20