I'm struggling with the following issue: I would like to draw a box to a certain M1-candle. Let's say the 12:53 candle.
The code below does it perfectly:
// @version=6
indicator("Test Timestamp", overlay = true)
string timeZone ="America/New_York"
int candle000test = timestamp(timeZone, year, month, dayofmonth, 12, 53) //candle 00:08
int routeEndTime = timestamp(timeZone, year, month, dayofmonth, 16, 44)
var box testing = na
if time == candle000test //and barstate.isconfirmed
testing := box.new(left = time, top = high, right = time + (routeEndTime - candle000test), bottom = low,
text = "19:53", text_size = size.tiny, text_color = color.black, text_halign = text.align_right, text_font_family = font.family_monospace,
border_color = color.new(color.gray, 50), bgcolor = color.new(color.gray, 50), xloc = xloc.bar_time)
If I switch to a higher timeframe, e.g. M15, the box vanishes. Does anybody know what I can do to display the M1 box in other timeframes?
Thank you very much.