verticalLine
A vertical line is a simple tool that lets you mark a specific time (candle) on the chart. Traders often use it to highlight important events, such as news releases, earnings, or just to separate sessions/days.
Syntax
verticalLine(time, styles?, text?)
Parameters
time: The candle time where the vertical line should be drawn (for example,
time(20)means 20 candles ago).text (optional): A short label to display on the line (if
showLabel: true).
Return Value
string — A unique drawing
id.
Example
This example will draw a blue vertical line every 30 candles to mark sections on the chart. We also add a label “Marker” so it’s clear what the line represents.
Result

Tips
Use vertical lines to highlight recurring patterns (like market opens or closes).
Dashed vertical lines are useful for visual guides without overwhelming the chart.
Warning
If
timeis invalid or outside the chart, the line won’t appear.Adding too many vertical lines too often can clutter the chart and make it hard to read.
Last updated