I'm fairly new to think script so I'm still learning a lot. I am trying to write a watchlist column where if one predefined condition is met, the watchlist column displays 1, if another predefined condition is met, the watchlist column displays -1, and if neither of those are true then it just displays 0. whenever I try to end with a plot command, it gives me an error that arrowDir already exists. Here's the section of the code that I'm having issues with.
Code:
def arrowDir = if UP1 then 1
else if DN1 then -1
else 0;
plot arrowDir;