Settings
A plain value at the top is a setting; int(), float() and friends add a label and limits.
For AI tools: this page as Markdown · the whole language in one file
Any top-level name set to a plain value becomes a setting in the chart's settings dialog, labelled from its name (fast_length shows as "Fast length"). There is no input keyword.
| You write | The setting is |
|---|---|
length = 14 | a whole number |
mult = 2.5 | a decimal |
source = close | a price dropdown: close, open, high, low, hl2, hlc3, ohlc4 |
smooth = true | a checkbox |
average = "ema" or "sma" | a dropdown; the first is the default |
col = blue | a color picker |
To give the type, a label or limits, write a typed input instead, still alone at the top. The label, min, max and step are all optional; min, max and step are for int and float.
| You write | The setting is |
|---|---|
length = int(14, "RSI length", min = 2, max = 200) | a whole number: the dialog keeps it whole |
mult = float(2, "Band width", min = 0.5, step = 0.25) | a decimal, even starting at a whole number |
smooth = bool(true, "Smooth it") | a checkbox |
average = string("ema" or "sma", "Average") | a dropdown of text (always text, even "high" or "low") |
src = source(close, "Price") | a price dropdown (source("close" or "hl2") offers just those) |
col = color(blue, "Line color") | a color picker |
1length = int(20, "Length", min = 2, max = 200)2mult = float(2, "Width", min = 0.5, max = 5, step = 0.25)3src = source(close, "Price")4average = string("ema" or "sma", "Average")5 6b = bands(src, length, mult)7plot(b.upper, "Upper")8plot(average == "ema" ? ema(src, length) : sma(src, length), "Average")9plot(b.lower, "Lower")- A number used as a length or a
prevcount is kept between 1 and 5000 automatically. - A saved value outside the limits (from an older version of the script) is used at the nearest limit.
- These words make settings only. Inside a formula, Pine's
int(x)isround(x),floor(x)orceil(x). - Every plotted line also gets color and width settings on the Style tab, and every fill an opacity.


