@Jimmy Here is your COMBINED label to display as a chart label. Note that because you are displaying multiple pieces of info, you won't be able to contain all this in a single watchlist UNLESS you simplify the display. This should give you some ideas how to best structure what you'd eventually like to implement
Code:
# Distance from SMA and VWAP
# tomsk
# 12.12.2019
input length = 9;
def sma = Average(close, length);
def DistanceSMA = (close - sma);
def vwapValue = VWAP();
def DistanceVWAP = (close - vwapValue);
AddLabel(1, "Distance SMA(" + length + ") = " + AsText(DistanceSMA) + " (" + AsPercent(close/sma-1) + ") " + "VWAP = " + AsText(DistanceVWAP) + " (" + AsPercent(close/vwapValue-1) + ")",
if close > sma and close > vwapValue then Color.GREEN else if close < sma and close < vwapValue then Color.RED else if close < sma and close > vwapValue then Color.YELLOW else if close
> sma and close < vwapValue then Color.ORANGE else Color.WHITE);
# End Distance from SMA and VWAP