How would I change the color of the text To Black what do I have to change or add ? Thank You
Code:
# creates custom watch list column that says "bullish" in green when both price > 50sma AND 50sma > 200sma
# or that says "bearish" in red when both price < 50sma AND 50sma < 200sma
# note the two risky or uncertain times are currently blank cells, both critera have been defined so that risky50over200 and risky200over50 could be used to create labels and/or color-coding for those conditions as well (via editing the AddLabel and/or the AssignBackgroundColor lines of code)
def x = SimpleMovingAvg("length" = 50);
def y = SimpleMovingAvg("length" = 200);
def risky50over200 = x > y AND close < x;
def risky200over50 = x < y AND close > x;
def bullish = close > x AND x > y;
def bearish = close < x AND x < y;
AddLabel (yes, if bearish then "bearish " else if bullish then "bullish " else " ");
AssignBackgroundColor (if bearish then color.RED else if bullish then color.GREEN else color.LIGHT_GRAY);
Last edited by a moderator: