There are many examples of this throughout this forum but so far we don't have a post the asks for a generic solution that can be applied to a wide variety of solutions. So I have updated the question of your title to make this post stand out when folks are searching for this exact solution.
Rather than try to use your example I created my own solution. The example you provided didn't really make sense. Why? Because your variable named "data" is never going to be negative. It will always be positive. And it does not make sense to display the word "Negative" when close is less than 1.
In my example I have created a variable named "upBar" that checks if the close of the current bar is higher than or equal to the close of the previous bar. The AddLabel() statement then checks to see if the current bar is an up bar and prints the words "Up Bar" in the watchlist column. If its not an up bar the watchlist column will display the words "Down Bar".
The color of text is set to change from green to red to match the color of the bar on the chart.
def upBar = close >= close;
AddLabel(yes, if upBar then "Up Bar" else "Down Bar", if upBar then Color.GREEN else Color.RED);
And you can only have one AddLabel() statement in a custom watchlist column. And if you use an AddLabe() statement in a custom watchlist column you must NOT have any plot statements.
Let's see if any of our viewers can work out a solution that displays the following text options in the custom watchlist column:
Technically speaking, a Doji bar may also be an inside bar or a an outside bar. So you must build the nested if/than/else statement to account for that. Good luck and have some fun!