---
id: "T:cAlgo.API.ChartIndicators"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/"
---

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

# ChartIndicators (interface)

The interface representing a chart indicator instances collection. Provides properties and events that allow for accessing various information about indicators attached to a chart.

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

- Cloud: Always empty: Count is 0, Add returns null, Remove returns false, and the events never fire.

## Definition

```csharp
public interface ChartIndicators
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
   protected override void OnStart()
   {
       foreach (var chartIndicator in ChartIndicators)
       {
            Print($"Name: {chartIndicator.Name} | Type: {chartIndicator.Type} | InstanceId: {chartIndicator.InstanceId} | Bar Outputs #: {chartIndicator.BarOutputs.Count} | Line Outputs #: {chartIndicator.LineOutputs.Count}");
       }

        ChartIndicators.IndicatorAdded += args => Print($"Chart indicator added, {args.Indicator.Name}");
        ChartIndicators.IndicatorRemoved += args => Print($"Chart indicator removed, {args.Indicator.Name}");
        ChartIndicators.IndicatorModified += args => Print($"Chart indicator modified, {args.Indicator.Name}");

       var sma = ChartIndicators.Add("Simple Moving Average", Bars.OpenPrices, 100);
   }
}
```

Python:

```python
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *

# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        for chartIndicator in api.ChartIndicators:
            print(f"Name: {chartIndicator.Name} | Type: {chartIndicator.Type} | InstanceId: {chartIndicator.InstanceId} | Bar Outputs #: {chartIndicator.BarOutputs.Count} | Line Outputs #: {chartIndicator.LineOutputs.Count}")

        api.ChartIndicators.IndicatorAdded += lambda args: print(f"Chart indicator added, {args.Indicator.Name}")
        api.ChartIndicators.IndicatorRemoved += lambda args: print(f"Chart indicator removed, {args.Indicator.Name}")
        api.ChartIndicators.IndicatorModified += lambda args: print(f"Chart indicator modified, {args.Indicator.Name}")

        sma = api.ChartIndicators.Add("Simple Moving Average", api.Bars.OpenPrices, 100)
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Methods

- `ChartIndicator Add(string name, object[] parameterValues)` — Adds a new indicator to a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Add/index.md)
- `ChartIndicator Add(IndicatorType type, object[] parameterValues)` — Adds a new indicator to a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Add/index.md)
- `bool Remove(ChartIndicator indicator)` — Removes an indicator from a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Remove/index.md)

## Properties

- `int Count {get;}` — Gets the number of all indicators attached to a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Count/index.md)
- `IReadonlyList<ChartIndicator> Custom {get;}` — Gets the list of chart custom indicators. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Custom/index.md)
- `ChartIndicator Item {get;}` — Gets an indicator attached to a chart by its instance ID. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Item/index.md)
- `IReadonlyList<ChartIndicator> Standard {get;}` — Gets the list of chart standard indicators. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/Standard/index.md)

## Events

- `event Action<ChartIndicatorAddedEventArgs> IndicatorAdded;` — Occurs when a new indicator is added to a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/IndicatorAdded/index.md)
- `event Action<ChartIndicatorModifiedEventArgs> IndicatorModified;` — Occurs when an indicator attached to a chart is modified. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/IndicatorModified/index.md)
- `event Action<ChartIndicatorRemovedEventArgs> IndicatorRemoved;` — Occurs when an indicator is removed from a chart. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Indicators/ChartIndicators/IndicatorRemoved/index.md)

