Relative Volume Watchlist Field


Category:
0
0

Hello Pete,
I have a Relative Volume column field on my watch list.
Code below
I wanted to know if it was possible to display text in RVOL field 5.0 or greater in GREEN and anything 4.99 or below in RED
Thanks for any help.
Ellis
input length = 21;
input offset = 1;
def ADV = Average(volume, length)[offset];
def rVol = volume /ADV;
AddLabel(yes, round(rVol,2));
AssignPriceColor(if rVol >= 1 then color.dark_red else if rVol <=.5 then Color.black else color.Gray);

Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on February 6, 2021 6:29 am
685 views
0
Private answer

In order to set the text color of the values displayed in your watchlist column you must include that logic within the AddLabel() statement:

AddLabel(yes, Round(rVol, 2), if rVol > 5.0 then Color.GREEN else Color.RED);

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 6, 2021 10:08 am
0
Thank you so much Pete for all your help with this. Ellis
( at February 6, 2021 10:28 am)