Skip to content

IIndicatorsAccessor.LinearRegressionIntercept

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

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

Definition

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

Parameters

Name C# type Python type Description
source DataSeries DataSeries The price source data used for calculation.
periods int int The period used for calculation.

Returns LinearRegressionIntercept — The Linear Regression Intercept indicator instance

Examples

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