Modify watchlist column color for VolumeAvg

M

mikewest

New member
VIP
I have the following condition for volume above average but instead of it showing one for above or 0 if not . I want the block on my watchlist to turn green if 1if not above avg it can stay black, doesn't matter. Thanks in Advance
SimpleMovingAvg() and VolumeAvg("length" = 1)."Vol" is greater than VolumeAvg("length" = 10)."VolAvg"
 
BenTen

BenTen

Administrative
Staff
VIP
Like this?

Code:
def condition = SimpleMovingAvg() and VolumeAvg("length" = 1)."Vol" is greater than VolumeAvg("length" = 10)."VolAvg";
plot static = 1;
AssignBackgroundColor(if condition == 1 then color.dark_green else color.black);
 
MerryDay

MerryDay

Active member
VIP
I didn't research the viability of your logic.
But here is the syntax:
Code:
def HiVol = SimpleMovingAvg() and VolumeAvg("length" = 1)."Vol" is greater than VolumeAvg("length" = 10)."VolAvg" ;
Addlabel(yes, " ");
AssignBackgroundColor(if HiVol then color.green else color.violet);
 

Similar threads

Top