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

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

# IIndicatorsAccessor.LinearRegressionIntercept

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

## LinearRegressionIntercept(DataSeries source, int periods)

The Linear Regression Intercept can be used together with the Linear Regression Slope indicator to plot the Linear Regression Line.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
LinearRegressionIntercept LinearRegressionIntercept(DataSeries source, int periods)
```

Python:

```python
api.Indicators.LinearRegressionIntercept(source: DataSeries, periods: int) -> LinearRegressionIntercept
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The price source data used for calculation.
- `periods` (`int`, Python `int`): The period used for calculation.

### Returns

`LinearRegressionIntercept` — The Linear Regression Intercept indicator instance

### Examples

C#:

```csharp
var intercept = Indicators.LinearRegressionIntercept(Bars.ClosePrices, 14);
Print("Linear Regression Intercept: {0}", intercept.Result.LastValue);
```

Python:

```python
intercept = api.Indicators.LinearRegressionIntercept(api.Bars.ClosePrices, 14)
api.Print(f"Linear Regression Intercept: {intercept.Result.LastValue}")
```

