I have the following script for a watch list column. My problem is when VolPctChg values are between 0% and -49% they display a red rather than yellow color. Iam trying to have values above zero display green and values between 0 and -50% display yellow and values below -50% display red. I would appreciate any help. Thanks.
Input length = 21;
Def vol = volume;
Def volAvg = Average(volume, length);
def volPctChg = 100 * ( vol - volAvg ) / volAvg;
plot VolumePercentChange = Round( volPctChg, 0 );
VolumePercentChange.AssignValueColor(if Volpctchg >.01 then color.GREEN else color.Yellow);
VolumePercentChange.AssignValueColor (if Volpctchg <-.50 then color.red else color.yellow);
Input length = 21;
Def vol = volume;
Def volAvg = Average(volume, length);
def volPctChg = 100 * ( vol - volAvg ) / volAvg;
plot VolumePercentChange = Round( volPctChg, 0 );
VolumePercentChange.AssignValueColor(if Volpctchg >.01 then color.GREEN else color.Yellow);
VolumePercentChange.AssignValueColor (if Volpctchg <-.50 then color.red else color.yellow);