How to add arrows to custom watchlist column

L

Learnbot

Member
VIP
Hello,
I have a pretty simple condition in my custom watchlist column as shows below, what I wanted to do is when this condition is true an up arrow would appear and when it is not true it would just stay blank.

Code:
plot MACD = MACD()."Value" is less than or equal to MACD()."ZeroLine" and MACD()."Value" crosses above MACD()."Avg";

I thought the following code would accomplish my needs but alas no such luck, can someone please help me and educate me as to what am I doing wrong?

Code:
Addlabel (yes,(if MACD then PaintingStrategy.ARROW_UP else double.nan));


thank you
 
BenTen

BenTen

Administrative
Staff
VIP
Wouldn't it be faster if you use the AssignBackgroundColor? It is probably not what you're looking for, but it's an alternative in case you can't display arrows in your watchlist column.

Something like this should work.

Code:
AssignBackgroundColor(if MACD then color.dark_red else color.gray);
 
L

Learnbot

Member
VIP
@BenTen Thank you for ur help, you are right Background color would be easier however, there are two conditions in my watchlist.

1. IF RSI is over sold then the column turns green
2. and the second condition mentioned above.

So what i wanted to basically see if when both conditions are met ( i see a green column with up arrow) then i can start paying attention to the stock till then just let it be.

thanks again bud
 
BenTen

BenTen

Administrative
Staff
VIP
@Learnbot No problem. Both conditions in the same watchlist? You can do something like this:

Code:
AssignBackgroundColor(if condition1 and condition2 then color.dark_red else color.gray);

I hope that helps.
 

Similar threads

Top