input.source

Lets the reader pick which series the script reads — the close, the high, a midpoint, and so on. It is the exception in this namespace: it returns a series float rather than an input-form value, so what you get back can differ on every bar.

input.source(series float defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → series float
ParameterTypeRequiredDescription
defvalseries floatyesThe series the control starts on. 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 series float — A series float, not an input-form value.

indicator("Source input")
plot(input.source(close, "Source"))

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