Inputs
Per-strategy parameters that surface in the analyzer UI for tuning and sweeping.
input.int
input.int(default, label, min?, max?, step?, tooltip?)
Integer parameter with optional range constraints.
Creates an integer input that appears in the settings panel when the user configures your indicator or strategy. The value is accessible as a class attribute via self.<field_name>.
Parameters
default(int, defaultrequired): Default valuelabel(str, defaultrequired): Display label in settings panelmin(int, defaultNone): Minimum allowed valuemax(int, defaultNone): Maximum allowed valuestep(int, default1): Increment step for the slidertooltip(str, defaultNone): Hover tooltip text
Returns
int
Example
period = input.int(14, "RSI Period", min=2, max=100)
length = input.int(20, "Length", min=1, max=500, step=5)
input.float
input.float(default, label, min?, max?, step?, tooltip?)
Decimal parameter for multipliers, thresholds, and ratios.
Parameters
default(float, defaultrequired): Default valuelabel(str, defaultrequired): Display label in settings panelmin(float, defaultNone): Minimum allowed valuemax(float, defaultNone): Maximum allowed valuestep(float, default0.1): Increment steptooltip(str, defaultNone): Hover tooltip text
Returns
float
Example
multiplier = input.float(2.0, "Std Dev", min=0.5, max=5.0, step=0.1)
input.color
input.color(default, label, tooltip?)
Color picker for line and fill colors.
Creates a color picker input. The value is a hex color string (e.g. "#2962FF") passed to plot(), hline(), and fill().
Parameters
default(str, defaultrequired): Default hex color stringlabel(str, defaultrequired): Display label in settings paneltooltip(str, defaultNone): Hover tooltip text
Returns
str (hex color)
Example
color = input.color("#2962FF", "Line Color")
input.bool
input.bool(default, label, tooltip?)
Toggle checkbox for enabling/disabling features.
Parameters
default(bool, defaultrequired): Default valuelabel(str, defaultrequired): Display label in settings paneltooltip(str, defaultNone): Hover tooltip text
Returns
bool
Example
show_fill = input.bool(True, "Show Fill")
input.string
input.string(default, label, options?, tooltip?)
Text input or dropdown selector.
When options is provided, renders as a dropdown. Without options, renders as a free-text input field.
Parameters
default(str, defaultrequired): Default valuelabel(str, defaultrequired): Display label in settings paneloptions(list[str], defaultNone): Allowed values, renders as dropdowntooltip(str, defaultNone): Hover tooltip text
Returns
str
Example
ma_type = input.string("SMA", "Type", options=["SMA", "EMA", "WMA"])
input.source
input.source(default, label, tooltip?)
Price source selector dropdown.
Creates a dropdown to select a price source. The value resolves to the corresponding pandas Series at runtime.
Parameters
default(Source, defaultrequired): Default Source enum valuelabel(str, defaultrequired): Display label in settings paneltooltip(str, defaultNone): Hover tooltip text
Returns
pandas Series (the selected price source)
Example
from quant_charts import Source
src = input.source(Source.CLOSE, "Price Source")
Notes
- Sources:
Source.CLOSE,.OPEN,.HIGH,.LOW,.HL2,.HLC3,.OHLC4