---
id: "M:cAlgo.API.ChartTemplateIndicators.Add(System.String,System.Object[])"
kind: "method"
type: "T:cAlgo.API.ChartTemplateIndicators"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplateIndicators/Add/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartTemplateIndicators.Add

Member of [ChartTemplateIndicators](https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplateIndicators/index.md).

## Add(string name, object[] parameterValues)

Adds a new indicator to a chart template.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.Indicators).

C#:

```csharp
ChartTemplateIndicator Add(string name, object[] parameterValues)
```

Python:

```python
chartTemplateIndicators.Add(name: str, parameterValues: list[object]) -> ChartTemplateIndicator
```

### Parameters

- `name` (`string`, Python `str`): The name of an indicator.
- `parameterValues` (`object[]`, Python `list[object]`): The indicator parameter values or an anonymous object that contains indicator parameter values.

### Returns

`ChartTemplateIndicator` — An `ChartTemplateIndicator` representing the added indicator instance.

Available since cAlgo.API 5.6.

### Examples

C#:

```csharp
var template = ChartTemplates.Get("My Template");
if (template != null)
{
    var indicator = template.Indicators.Add("Simple Moving Average", Bars.ClosePrices, 50);
    Print("Added indicator {0} to the template", indicator.Type.Name);
}
```

Python:

```python
template = api.ChartTemplates.Get("My Template")
if template is not None:
    indicator = template.Indicators.Add("Simple Moving Average", api.Bars.ClosePrices, 50)
    api.Print(f"Added indicator {indicator.Type.Name} to the template")
```

## Add(IndicatorType type, object[] parameterValues)

Adds a new indicator to a chart template.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.Indicators).

C#:

```csharp
ChartTemplateIndicator Add(IndicatorType type, object[] parameterValues)
```

Python:

```python
chartTemplateIndicators.Add(type: IndicatorType, parameterValues: list[object]) -> ChartTemplateIndicator
```

### Parameters

- `type` (`IndicatorType`, Python `IndicatorType`): The type of Indicator, you can get IndicatorType from AlgoRegistry.
- `parameterValues` (`object[]`, Python `list[object]`): The indicator parameter values or an anonymous object that contains indicator parameter values.

### Returns

`ChartTemplateIndicator` — An `ChartTemplateIndicator` representing the added indicator instance.

Available since cAlgo.API 5.6.

### Examples

C#:

```csharp
var template = ChartTemplates.Get("My Template");
if (template != null && AlgoRegistry.Get("Relative Strength Index", AlgoKind.StandardIndicator) is IndicatorType rsiType)
{
    var indicator = template.Indicators.Add(rsiType, new { Source = Bars.ClosePrices, Periods = 14 });
    Print("Added indicator {0} to the template", indicator.Type.Name);
}
```

Python:

```python
template = api.ChartTemplates.Get("My Template")
rsiType = api.AlgoRegistry.Get("Relative Strength Index", AlgoKind.StandardIndicator)
if template is not None and rsiType is not None:
    indicator = template.Indicators.Add(rsiType, api.Bars.ClosePrices, 14)
    api.Print(f"Added indicator {indicator.Type.Name} to the template")
```

