timeframe.period - Pine Script Variable
timeframe.period
Section titled “timeframe.period”Overview
Section titled “Overview”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.
stringQualifier
Section titled “Qualifier”simple
Remarks
Section titled “Remarks”- To always access the script’s main timeframe, even within another context, use the timeframe.main_period variable.