Skip to content

IIndicatorsAccessor.LinearRegressionRSquared

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The R Squared or coefficient of determination indicator's main purpose is the confirm the strength of the market.

Definition

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

Parameters

Name C# type Python type Description
source DataSeries DataSeries The source data used for calculation.
periods int int The value of the periods used for calculation.

Returns LinearRegressionRSquared — Linear Regression R-Squared indicator instance

Examples

var rSquared = Indicators.LinearRegressionRSquared(Bars.ClosePrices, 14);
Print("R squared: {0}", rSquared.Result.LastValue);
rSquared = api.Indicators.LinearRegressionRSquared(api.Bars.ClosePrices, 14)
api.Print(f"R squared: {rSquared.Result.LastValue}")