> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference guide for input parameters in Indie indicators. Covers @param decorators, parameter types, and configuration with practical examples.

# Input parameters

*Input parameters* provide a convenient way to change indicator's algorithm parameters without the need to change its
source code. For example, here is a simple indicator that calculates SMA with two parameters `src` and `length`:

```py theme={null}
# indie:lang_version = 5
from indie import indicator, param, source
from indie.algorithms import Sma

@indicator('Example')
@param.source('src', default=source.CLOSE, title='Source')
@param.int('length', default=12, min=1, title='Length')
def Main(self, src, length):
    sma = Sma.new(src, length)
    return sma[0]
```

Once this indicator is added to a chart, the values for the `length` and `source` parameters can be easily changed
in the indicator's *Settings* dialog:

<img src="https://mintcdn.com/takeprofit-a5dc0462/G8Lo_-_8Elf7cBMe/images/indie/Input-parameters/01-Settings_dialog.png?fit=max&auto=format&n=G8Lo_-_8Elf7cBMe&q=85&s=7a6385b89c734c5dafcb7aa7be7da286" alt="Figure 7.1. The Settings dialog of indicator." width="978" height="642" data-path="images/indie/Input-parameters/01-Settings_dialog.png" />

## How to add a parameter to an indicator

There are a few simple steps for adding an input parameter to an indicator:

* Add one of the `@param.*` decorators (e.g. `@param.int`) to the `Main` entry point of the indicator.
* Pass values for the two required arguments to the decorator:
  * `id` — which is unique string identifier of the parameter (the very first argument of any `@param.*` decorator),
  * `default` — which is a default value of the parameter.
* Pass values to optional arguments of the decorator if needed (this depends on the decorator type, they
  could differ). In the example above there are optional arguments `title` and `min`.
* Add a parameter to the `Main` function (after the `self` parameter) with the name matching the `id` of the
  parameter.

## Available parameter types

Indie supports several types of input parameters, they are:

* `int`, created with decorator [`@param.int`](/indie/Library-reference/package-indie#decor_param_int)
* `bool`, created with decorator [`@param.bool`](/indie/Library-reference/package-indie#decor_param_bool)
* `float`, created with decorator [`@param.float`](/indie/Library-reference/package-indie#decor_param_float)
* `str`, created with decorator [`@param.str`](/indie/Library-reference/package-indie#decor_param_str)
* source of type [`SeriesF`](/indie/Library-reference/package-indie#class_SeriesF), created with decorator [`@param.source`](/indie/Library-reference/package-indie#decor_param_source)
* time frame of type [`TimeFrame`](/indie/Library-reference/package-indie#class_TimeFrame), created with decorator [`@param.time_frame`](/indie/Library-reference/package-indie#decor_param_time_frame)
