Skip to content
Algo Trade Analytics Docs
Pine library page — review pending. This page is preserved for compatibility but is not part of the reviewed search index. Check the official Pine Script v6 reference before relying on its explanation, signature, or example.

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)