---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.Envelopes(System.Int32,cAlgo.API.MovingAverageType,System.Double)"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/Envelopes/"
---

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

# IIndicatorsAccessor.Envelopes

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

## Envelopes(int periods, MovingAverageType maType, double deviation)

The Envelopes indicator is used to visualize potential trading ranges and overbought/oversold conditions.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Envelopes Envelopes(int periods, MovingAverageType maType, double deviation)
```

Python:

```python
api.Indicators.Envelopes(periods: int, maType: MovingAverageType, deviation: float) -> Envelopes
```

### Parameters

- `periods` (`int`, Python `int`): The periods used in the calculation.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type
- `deviation` (`double`, Python `float`): The distance from the moving average in percents

### Returns

`Envelopes` — Envelopes indicator instance

### Examples

C#:

```csharp
var envelopes = Indicators.Envelopes(20, MovingAverageType.Simple, 0.1);
Print("Envelopes upper: {0}, main: {1}, lower: {2}", envelopes.Upper.LastValue, envelopes.Main.LastValue, envelopes.Lower.LastValue);
```

Python:

```python
envelopes = api.Indicators.Envelopes(20, MovingAverageType.Simple, 0.1)
api.Print(f"Envelopes upper: {envelopes.Upper.LastValue}, main: {envelopes.Main.LastValue}, lower: {envelopes.Lower.LastValue}")
```

## Envelopes(DataSeries source, int periods, MovingAverageType maType, double deviation)

The Envelopes indicator is used to visualize potential trading ranges and overbought/oversold conditions.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
Envelopes Envelopes(DataSeries source, int periods, MovingAverageType maType, double deviation)
```

Python:

```python
api.Indicators.Envelopes(source: DataSeries, periods: int, maType: MovingAverageType, deviation: float) -> Envelopes
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The source data used for calculation.
- `periods` (`int`, Python `int`): The periods used in the calculation.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type
- `deviation` (`double`, Python `float`): The distance from the moving average in percents

### Returns

`Envelopes` — Envelopes indicator instance

### Examples

C#:

```csharp
var envelopes = Indicators.Envelopes(Bars.ClosePrices, 20, MovingAverageType.Simple, 0.1);
if (Symbol.Bid > envelopes.Upper.LastValue)
    Print("Bid is above the upper envelope {0}", envelopes.Upper.LastValue);
```

Python:

```python
envelopes = api.Indicators.Envelopes(api.Bars.ClosePrices, 20, MovingAverageType.Simple, 0.1)
if api.Symbol.Bid > envelopes.Upper.LastValue:
    api.Print(f"Bid is above the upper envelope {envelopes.Upper.LastValue}")
```

