TradeZoro
Notifications

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)
50365042504850535059Day high 5073.16
Sample bars, not market data. Day high label.

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.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home