# Inputs

Per-strategy parameters that surface in the analyzer UI for tuning and sweeping.

<a id="input-int"></a>
## input.int

```python
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`, default `required`): Default value
- `label` (`str`, default `required`): Display label in settings panel
- `min` (`int`, default `None`): Minimum allowed value
- `max` (`int`, default `None`): Maximum allowed value
- `step` (`int`, default `1`): Increment step for the slider
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

int

### Example

```python
period = input.int(14, "RSI Period", min=2, max=100)
length = input.int(20, "Length", min=1, max=500, step=5)
```

<a id="input-float"></a>
## input.float

```python
input.float(default, label, min?, max?, step?, tooltip?)
```

Decimal parameter for multipliers, thresholds, and ratios.

### Parameters

- `default` (`float`, default `required`): Default value
- `label` (`str`, default `required`): Display label in settings panel
- `min` (`float`, default `None`): Minimum allowed value
- `max` (`float`, default `None`): Maximum allowed value
- `step` (`float`, default `0.1`): Increment step
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

float

### Example

```python
multiplier = input.float(2.0, "Std Dev", min=0.5, max=5.0, step=0.1)
```

<a id="input-color"></a>
## input.color

```python
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()`](https://quantchartsllc.com/docs/python/py-plotting.md#plot), [`hline()`](https://quantchartsllc.com/docs/python/py-plotting.md#hline), and [`fill()`](https://quantchartsllc.com/docs/python/py-plotting.md#fill).

### Parameters

- `default` (`str`, default `required`): Default hex color string
- `label` (`str`, default `required`): Display label in settings panel
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

str (hex color)

### Example

```python
color = input.color("#2962FF", "Line Color")
```

<a id="input-bool"></a>
## input.bool

```python
input.bool(default, label, tooltip?)
```

Toggle checkbox for enabling/disabling features.

### Parameters

- `default` (`bool`, default `required`): Default value
- `label` (`str`, default `required`): Display label in settings panel
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

bool

### Example

```python
show_fill = input.bool(True, "Show Fill")
```

<a id="input-string"></a>
## input.string

```python
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`, default `required`): Default value
- `label` (`str`, default `required`): Display label in settings panel
- `options` (`list[str]`, default `None`): Allowed values, renders as dropdown
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

str

### Example

```python
ma_type = input.string("SMA", "Type", options=["SMA", "EMA", "WMA"])
```

<a id="input-source"></a>
## input.source

```python
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`](https://quantchartsllc.com/docs/python/py-logging.md#source), default `required`): Default Source enum value
- `label` (`str`, default `required`): Display label in settings panel
- `tooltip` (`str`, default `None`): Hover tooltip text

### Returns

pandas Series (the selected price source)

### Example

```python
from quant_charts import Source
src = input.source(Source.CLOSE, "Price Source")
```

### Notes

- Sources: `Source.CLOSE`, `.OPEN`, `.HIGH`, `.LOW`, `.HL2`, `.HLC3`, `.OHLC4`
