How to make lines transition among 3 colors

Can someone help me combine these statements? I am using the color of the Bollinger band lines to filter out bad trades but I would like to have a third color to show a weaker buy or sell permission.
Buy Green = good to go, Cyan = good but low volume, Gray = no buy
Sell Red = good to go, Magenta = good but low volume, Gray = no buy
Here is my current code(section)


Code:
bb_upperband.AssignValueColor(if (Teeth > Jaw or Lips > Jaw)and (RangeRatio > RangeFactor) then Color.GREEN else Color.GRAY);

#the weaker buy signal
bb_upperband.AssignValueColor(if (Teeth > Jaw or Lips > Jaw) then Color.Cyan else Color.GRAY);


bb_lowerband.AssignValueColor(if (Teeth > Lips or Jaw > Lips)and (RangeRatio > RangeFactor) then Color.RED else Color.GRAY);

#the weaker sell signal
bb_lowerband.AssignValueColor(if (Teeth > Lips or Jaw > Lips) then Color.Magenta else Color.GRAY);
 
Last edited:
Solution
Figured it out. Here it is - I hope this helps anyone else

Code:
bb_upperband.AssignValueColor(if(Teeth > Jaw or Lips > Jaw)and (RangeRatio > RangeFactor) then Color.GREEN else if Teeth > Jaw or Lips > Jaw then Color.CYAN else Color.GRAY);

bb_lowerband.AssignValueColor(if(Teeth > Lips or Jaw > Lips)and (RangeRatio > RangeFactor) then Color.Red else if Teeth > Jaw or Lips > Jaw then Color.Orange else Color.GRAY);
Figured it out. Here it is - I hope this helps anyone else

Code:
bb_upperband.AssignValueColor(if(Teeth > Jaw or Lips > Jaw)and (RangeRatio > RangeFactor) then Color.GREEN else if Teeth > Jaw or Lips > Jaw then Color.CYAN else Color.GRAY);

bb_lowerband.AssignValueColor(if(Teeth > Lips or Jaw > Lips)and (RangeRatio > RangeFactor) then Color.Red else if Teeth > Jaw or Lips > Jaw then Color.Orange else Color.GRAY);
 
Solution

Similar threads

Top