Skip to content
Algo Trade Analytics Docs

second - Pine Script Variable

Current bar second in exchange timezone.

int

series

  • Returns the second based on the bar’s opening time in the exchange timezone.
  • Guard with timeframe.isseconds when building logic that only makes sense on second charts.
//@version=6
indicator("30-second ticks", overlay=true)
isSecondChart = timeframe.isseconds
highlight = isSecondChart and second % 30 == 0
plotshape(highlight, style=shape.circle, location=location.bottom, size=size.tiny)