I want to assign value colors on my watch list. I am looking at the 50 day volume percent change and 50 day price percent change and assigning a color based on the value being a positive or negative percent. Here is the script that I have so far. The problem seems to be on the last line of script. I need to add a word or something in front of the AssignValueColor. Here is the script.
input length = 50; def vol = volume; def volAvg = Average( volume, length ); def volPctChg = 100 * ( vol - volAvg ) / volAvg; plot VolumePercentChange = Round( volPctChg, 0 ); input lookback = 50; def price = close; def priceAvg = Average( price, length ); def pricePctChg = 100 * ( price - priceAvg ) / priceAvg; plot pricePercentChange = Round( pricePctChg, 0 ); AssignVallueColor (if pricePctChg >=1 and volPctChg <= 1 then color.Yellow else color.White);