// Determine time points (UNIX timestamps) for anchoring the rays prevDayTime = request.security(syminfo.tickerid, "D", time[1], lookahead=barmerge.lookahead_on) prevWeekTime = request.security(syminfo.tickerid, "W", time[1], lookahead=barmerge.lookahead_on) prevMonthTime = request.security(syminfo.tickerid, "M", time[1], lookahead=barmerge.lookahead_on)
// Create variables to store the rays var line dayHighRay = na var line dayLowRay = na var line weekHighRay = na var line weekLowRay = na var line monthHighRay = na var line monthLowRay = na
// Create or update the rays using time for x-coordinates if na(dayHighRay) dayHighRay := line.new(x1=prevDayTime, y1=prevDayHigh, x2=timestamp("2100-01-01 00:00"), y2=prevDayHigh, color=color.green, width=1, extend=extend.right, xloc=xloc.bar_time)