You should use a 'label' if you want to display some text. Set its y argument to your hline's value, and manipulate the x argument as you wish.
You can use bar_index, chart.left_visible_bar_time or chart.right_visible_bar_time to manipulate the x coordinate.
Below are some examples:
//@version=5 indicator("My script") hline_price_1 = 100 hline_price_2 = 75 hline_price_3 = 50 hline_price_4 = 25 hline(hline_price_1) hline(hline_price_2) hline(hline_price_3) hline(hline_price_4) label hline_label_1 = label.new(bar_index, hline_price_1, str.tostring(hline_price_1), style=label.style_none, textcolor=color.white) label hline_label_2 = label.new(bar_index - 50, hline_price_2, str.tostring(hline_price_2), style=label.style_none, textcolor=color.white) label hline_label_3 = label.new(chart.left_visible_bar_time, hline_price_3, str.tostring(hline_price_3), xloc=xloc.bar_time, style=label.style_none, textcolor=color.white) label hline_label_4 = label.new(chart.right_visible_bar_time, hline_price_4, str.tostring(hline_price_4), xloc=xloc.bar_time, style=label.style_none, textcolor=color.white) label.delete(hline_label_1[1]) label.delete(hline_label_2[1]) label.delete(hline_label_3[1]) label.delete(hline_label_4[1]) 1