I am not sure if this any additional help you all. But, since this site has been helpful to me and I will share a few features I've added. Please see the code below and attached screenshots. I started plotting a line where 52 Wk Hi/Lo and the were displayed improper or not acceptable due to appearance setting "Fit Studies". So, I use bubbles instead to display last close/price. Since I am bullish near 52Wk Hi is one of my fav strategies, I only coded to add "percent near 52 Wk Hi". I hope this helps you. Good luck... cabe1332
#52 Wk High and Low Label
# created by cabe1332 20210115_1730
# Start code
# determine if close greater than 52 wk hi and lo
def Highstate = if close >= Highest(high(period = AggregationPeriod.Week),52) then 1 else 0;
def Lowstate = if close <= Lowest(low(period = AggregationPeriod.Week),52) then 1 else 0;
# change background def if within 10% then green else light.gray
def HighstateRange = if (close >= Highest(high(period = AggregationPeriod.Week),52) * (.8995)) then 1 else 0;
# calculate percentChg diff
def Pctawayhi = Round((close / Highest(high(period = AggregationPeriod.Week),52) - 1) * (-100));
# label for 52 Wk High
AddLabel(yes, " Price " + round(Pctawayhi,0) + "% away from " + "52Wk High: " + Highest(high(period = AggregationPeriod.Week),52) + " ", if Highstaterange then Color.GREEN else Color.light_GRAY);
# label for 52 Wk Low
AddLabel(yes, "52Wk Low: " + Lowest(low(period = AggregationPeriod.Week),52), if Lowstate then Color.Red else Color.light_GRAY);
# instead of the plotting a line, bubble is use to support "Fit Studies" appearance setting
# bubble for current bar
input barsback = 0;
input price = close;
def bn = BarNumber();
def currentBar = HighestAll(if !IsNaN(price) then bn else Double.NaN);
# bubble shows currentBar price (buy or sell), if price within 10% addChartBubble percent value
addChartBubble(bn == currentBar - barsBack, close, if Highstaterange then "Price " + round(close,4) + " | " + round(Pctawayhi,0) + "% near 52Wk High" else "Price " + round(close,4),if price > price[1] then color.light_green else color.light_red);
# end of code