Skip to content
Algo Trade Analytics Docs

timeframe.period - Pine Script Variable

A string representation of the script’s main timeframe or a requested timeframe, depending on how the script uses it. The variable’s value represents the timeframe of a requested dataset when used in the expression argument of a request.*() function call. Otherwise, its value represents the script’s main timeframe (timeframe.main_period), which equals either the timeframe argument of the indicator declaration statement or the chart’s timeframe.

string

simple

  • To always access the script’s main timeframe, even within another context, use the timeframe.main_period variable.