input.timeframe

Asks the reader for a timeframe. The answer arrives as a string. Note what it is not: choosing a timeframe here does not fetch that timeframe’s data. Lipi has no way to request another symbol’s or another interval’s series.

input.timeframe(const string defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input string
ParameterTypeRequiredDescription
defvalconst stringyesThe timeframe the control starts at. Required.
titleconst stringnoThe label shown beside the control.
tooltipconst stringnoHelp text for the control.
inlineconst stringnoA key that puts several controls on one row.
groupconst stringnoA heading the control sits under.
confirmconst boolnoAsks the reader to confirm the value.

Returns input string — An input string.

indicator("Timeframe input")
chosen = input.timeframe("1D", "Timeframe")
alert(chosen)
plot(close)

See also inputs · input.bool · input.color · input.float

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade