src and length:
length and source parameters can be easily changed
in the indicator’s Settings dialog:

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 theMainentry 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
titleandmin. - Add a parameter to the
Mainfunction (after theselfparameter) with the name matching theidof the parameter.
Available parameter types
Indie supports several types of input parameters, they are:int, created with decorator@param.intbool, created with decorator@param.boolfloat, created with decorator@param.floatstr, created with decorator@param.str- source of type
SeriesF, created with decorator@param.source - time frame of type
TimeFrame, created with decorator@param.time_frame - calculation time frame, created with decorator
@param.calc_time_frame - color of type
Color, created with decorator@param.color
Grouping parameters
Every@param.* decorator takes an optional group keyword. Parameters that share the same group string are shown together under a section header in the Settings dialog:
Adding a help tooltip
Every@param.* decorator takes an optional tooltip keyword. When it is set, the Settings dialog shows an info icon
right after the parameter’s title, and hovering it shows the text. Use it to explain what the parameter does or how
its options differ, without making the title long:
tooltip shows no icon.
Showing a parameter only when it applies
Every@param.* decorator takes an optional show_if keyword. The parameter then appears in the Settings dialog
only while the condition holds, which keeps the dialog short: show a few inputs by default and reveal the advanced ones
when the user asks for them.
A common pattern is a Preset select with a Custom option that reveals the inputs the presets set:
Condition forms
Option names are written without quotes inside the condition. To reuse a condition on several parameters, put it in a
module-level constant, for example
CUSTOM = 'preset == Custom', and pass show_if=CUSTOM.
Conditions chain: a parameter is shown only if its own condition holds and the parameter it refers to is shown.
In the example, Smoothing length refers to smooth, so it stays hidden under the Standard and Wide presets
even if Smooth the basis was turned on earlier.
Compilation errors
The compiler checks every condition. It reports an error if the condition:- refers to a parameter that does not exist, or to the parameter itself;
- creates a cycle, for example
adepends onbandbdepends ona; - uses the
'flag'or'not flag'form with a parameter that is not a@param.bool; - uses
==or!=with a parameter that is not a@param.strwithoptions, or with a value that is not one of its options; - uses
!=in a way that excludes every option, so the parameter could never be shown; - uses a word of the condition syntax, such as
not, as a parameter id; - is empty or longer than 256 characters.