I have found a solution to my original question.
How 'clean' it is I don't know but it works
Option 1 - Offset each // Lines to Plot
Original
// Lines to Plot
targetTime = timestamp(2025,03,14,06,54,00)
drawVerticalLine(targetTime)
Solution
targetTime = timestamp(2025,03,14,06,54,00)
offsetTime = targetTime - (time - time[1])
drawVerticalLine(offsetTime)
Option 2 - Offset within // Function drawVerticalLine
// Function drawVerticalLine
drawVerticalLine(targetTime) =>
line.new (
x1=targetTime - (time - time[1]) ,
y1=low,
x2=targetTime - (time - time[1]) ,
y2=high,
xloc=xloc.bar_time,
extend=extend.both,
color=color.new(#f9961e, 10),
style=line.style_solid,
width=1)
Logic
calculates the duration of 1 bar
time - time[1]
calculates the duration of 2 bars
time - time[2]
subtracts 1 bar
- (time - time[1])
adds 1 bar
+ (time - time[1])
adds 2 bars
+ (time - time[2])