String output from IF

I am trying to add a chart element that has a bit of logic and then outputs a particular string based on that logic. But despite the IF() function supporting string outputs according to the documentation. If you take that as the output for a script and use it with a watchlist column or chart element it returns to a boolean output.
Can you make the script return the string?

e.g. (from the documentation)

IF(Close()>Open(),"Bullish", "Bearish")

returns 0 or 1, rather than Bullish or Bearish

Hi Angus,

The IF function can’t output text strings - do you know where in the documentation you saw that?

The Analysis Tile can be used to display a label for a true/false condition. Would that work?


Hi Darren,

My apologies, I could have sworn I pulled that direct from documents, but poking around my history it turns out it was just the chatbot hallucinating.

The reason I am looking for string outputs is that the logic is actually about 3 nested if statements. I can deal with numeric outputs, if needed, but strings would have been better.

No worries - yes the chatbot is still learning the scripting syntax and doesn’t often get it right!