Sidechair

timeframe.isintraday

Browse the reference

True when the chart's timeframe is shorter than one day: seconds, ticks or minutes.

Try it in the editor

timeframe.isintraday is true on a 1-second, 15-minute or 4-hour chart and false on a daily, weekly or monthly chart. It is a simple bool, fixed for the whole run.

Use it to pick settings that make sense for the timeframe, to turn on session logic that only works within a day, or to skip a calculation that has no meaning on daily bars.

Type

simple bool

Remarks

  • timeframe.isdwm is the opposite choice for daily and above. Exactly one of isintraday and isdwm is true on any chart.
  • On Sidechair: true when the chart's bar length is under 86,400 seconds, which covers seconds and minutes. timeframe.isticks is always false.

Example

Pine ScriptLength by timeframeOpen in editor
//@version=6
indicator("Intraday length", overlay = true)
len = timeframe.isintraday ? 20 : 50
plot(close, "Close", color.gray)
plot(ta.sma(close, len), "SMA", color.blue, 2)

See also

Runs on Sidechair