I was wondering if someone would be able to point me in the right direction:
Thank you so much anyone for any help with this!
- I'm trying to add a vertical line, at the 1500 hour time frame, on an intraday chart (or whatever time I choose).
- I'd like to be able to change the color of the vertical line as needed.
Thank you so much anyone for any help with this!
Code:
declare hide_on_daily;
input timeToDrawLine = 1500; # Time in HHMM format for 24-hour clock
input lineColor = {default Cyan, Red, Green, Blue, Magenta, Yellow, Orange, Pink}; # Dropdown to select line color
def targetTime = SecondsFromTime(timeToDrawLine) == 0;
def shouldDraw = targetTime and !targetTime[1]; # Draw once at the transition from false to true
AddVerticalLine(shouldDraw, "Vertical Line at " + timeToDrawLine, lineColor, Curve.SHORT_DASH);