Documentation Index
Fetch the complete documentation index at: https://docs.darvas.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
input.* functions declare user-configurable parameters. Each call appears in the Inputs panel as a form control. You must call them at the top level of your script - never inside onBar.
Function reference
Integer spinner.
opts: { min, max, step, group }.Float spinner. Same opts as
input.int.Checkbox toggle.
Text field. Pass
opts.options for a dropdown.Color picker. Returns a hex color string.
OHLCV source selector. Returns a function you pass directly to
ta.*.
The default must be one of "open", "high", "low", "close", "hl2", "hlc3", "ohlc4".Form control mapping
| Input type | Rendered control |
|---|---|
input.int / input.float | Number spinner with optional min/max/step |
input.bool | Checkbox |
input.string with options | Dropdown select |
input.string without options | Text field |
input.color | Color picker |
input.source | OHLCV source dropdown |
Grouping inputs
Use thegroup option to visually separate inputs in the panel:
The source function pattern
input.source returns an (offset?) => number | null function - the same shape as ctx.close, ctx.open, etc. Pass it directly to ta.*; do not call it yourself:
Related pages
Script lifecycle
Why top-level code runs once and onBar runs per bar.
Bar context
Built-in OHLCV accessors that share the source function shape.