---
id: "P:cAlgo.API.Indicators.KeltnerChannels.Main"
kind: "property"
type: "T:cAlgo.API.Indicators.KeltnerChannels"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/KeltnerChannels/Main/"
---

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

# KeltnerChannels.Main

Member of [KeltnerChannels](https://help.ctrader.com/ctrader-algo/references/Indicators/KeltnerChannels/index.md).

## Main

Moving Average Line

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
IndicatorDataSeries Main {get;}
```

Python:

```python
keltnerChannels.Main: IndicatorDataSeries
```

### Returns

`IndicatorDataSeries` — 

### Examples

C#:

```csharp
var keltnerChannels = Indicators.KeltnerChannels(20, MovingAverageType.Exponential, 10, MovingAverageType.Simple, 2);
var trend = Bars.ClosePrices.Last(1) > keltnerChannels.Main.Last(1) ? "above" : "below";
Print("Close is {0} the Keltner middle line {1}", trend, keltnerChannels.Main.Last(1));
```

Python:

```python
keltnerChannels = api.Indicators.KeltnerChannels(20, MovingAverageType.Exponential, 10, MovingAverageType.Simple, 2)
trend = "above" if api.Bars.ClosePrices.Last(1) > keltnerChannels.Main.Last(1) else "below"
api.Print(f"Close is {trend} the Keltner middle line {keltnerChannels.Main.Last(1)}")
```

