Skip to content
TradequixDocsOpen the terminal
OverviewStart here, search, progress
  • Introduction
  • Quickstart
  • How a script runs
  • Types and qualifiers
  • Operators, conditionals and loops
  • Functions and methods
  • Objects and enums
  • Arrays, matrices and maps
  • Strings and colours
  • Time and sessions
  • Bar states
  • Plotting
  • Inputs
  • Technical analysis
  • Drawings and tables
  • Multiple timeframes
  • Strategies
  • Alerts in scripts
  • Repainting
  • The Pine editor
  • Indicator settings
  • Coming from TradingView
  • The data
  • Publish and sell
  • Catalogue and community
  • Your dashboard and earnings
  • Errors and debugging
  • Limits
  • Coverage
  • Built-in catalogue
  • Cookbook
  • Write Pine with AI
  • FAQ
  • Glossary
  • Cheat sheet
  • Function reference
  • Will it run here?
  • Error index
Function reference

Bar states, time, timeframe, session

What the script knows about the bar, the chart and the clock. The feed trades 24x7 on UTC.

41 names from PineTS 0.11.1 · 8 with full entries

barstate.islast

Verified
barstate.islast

true on the last bar on the chart.

barstate.isconfirmed

Verified
barstate.isconfirmed

true once a bar has closed. Use for signals that must not change.

barstate.isfirst

Supported
barstate.isfirst

true on the first bar.

barstate.isrealtime

Supported
barstate.isrealtime

true on bars that formed while the chart was open.

timeframe.period

Supported
timeframe.period

The chart's timeframe as a Pine string, for example "5" or "15S".

timeframe.in_seconds

Supported
timeframe.in_seconds(timeframe)

A timeframe string in seconds.

timeframe.change

Supported
timeframe.change(timeframe)

true on the first chart bar of a new higher-timeframe bar.

runtime.error

Supported
runtime.error(message)

Stops the script with your message, shown in the console.

Everything else in Bar states, time, timeframe, session

Also implemented. These follow TradingView’s Pine v6 reference for their arguments.

  • barstate.ishistorySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • barstate.islastconfirmedhistorySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • barstate.isnewSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.from_secondsSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isdailySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isdwmSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isintradaySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isminutesSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.ismonthlySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.issecondsSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isticksSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.isweeklySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.main_periodSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • timeframe.multiplierSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.isfirstbarSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.isfirstbar_regularSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.islastbarSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.islastbar_regularSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.ismarketSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.ispostmarketSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • session.ispremarketSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.heikinashiSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.inheritSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.kagiSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.linebreakSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.modifySupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.newSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.pointfigureSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.renkoSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • ticker.standardSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • log.errorSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • log.infoSupportedImplemented. Arguments as in TradingView's Pine v6 reference.
  • log.warningSupportedImplemented. Arguments as in TradingView's Pine v6 reference.

On this page

  • barstate.islast
  • barstate.isconfirmed
  • barstate.isfirst
  • barstate.isrealtime
  • timeframe.period
  • timeframe.in_seconds
  • timeframe.change
  • runtime.error
  • Everything else (33)