Cookbook
Label the day's high
Write the high of the day on the newest bar.
//@zscript 1
indicator("Day high label", overlay=true)
var float dayHigh = na
if dayofmonth != dayofmonth[1]
dayHigh := high
else
dayHigh := math.max(dayHigh, high)
if barstate.islast
label.new(bar_index, dayHigh, "Day high " + str.tostring(dayHigh, "#.##"), style=label.style_label_left)
How it works
Drawing only on barstate.islast keeps the script light: one label, not thousands.
Education only. Not financial advice. Examples are teaching samples, not trading results.
