indicator("My study", max_labels_count=500, overlay=true)
var float[] prices = array.new_float()
var string[] ids = array.new_string()
var int[] date = array.new_int()
f_data(_price, _id, _date) =>
array.push(prices, _price)
array.push(ids, _id)
array.push(date, _date)
f_label(_idx) =>
labelText = "TRADE: " + array.get(ids, _idx) + "\n\n BUY: " + str.tostring(array.get(prices, _idx))
label.new(array.get(date, _idx), array.get(prices, _idx), labelText, xloc.bar_time, yloc.belowbar, color=color.red, textcolor=color.white, style=label.style_label_up)
if barstate.isfirst
f_data(8, 'CF442W', timestamp(2022, 01, 10, 0, 0, 0))
f_data(6, 'WI211KK', timestamp(2021, 05, 23, 0, 0, 0))
if barstate.islast
for i = 0 to array.size(ids) - 1
f_label(i)