Class RegressionChannel
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
The Regression Channel indicator extends the LeastSquaresMovingAverage with the inclusion of two (upper and lower) channel lines that are distanced from the linear regression line by a user defined number of standard deviations. Reference: http://www.onlinetradingconcepts.com/TechnicalAnalysis/LinRegChannel.html
public class RegressionChannel : Indicator, IIndicator, IUpdatable
- Inheritance
-
RegressionChannel
- Implements
- Inherited Members
- Extension Methods
Constructors
RegressionChannel(int, double)
Initializes a new instance of the LeastSquaresMovingAverage class.
public RegressionChannel(int period, double k)
Parameters
periodintThe number of data points to hold in the window.
kdoubleThe number of standard deviations specifying the distance between the linear regression and upper or lower channel lines
RegressionChannel(string, int, double)
Initializes a new instance of the RegressionChannel class.
public RegressionChannel(string name, int period, double k)
Parameters
namestringThe name of this indicator
periodintThe number of data points to hold in the window
kdoubleThe number of standard deviations specifying the distance between the linear regression and upper or lower channel lines
Properties
Intercept
The point where the regression line crosses the y-axis (price-axis)
public IndicatorBase Intercept { get; }
Property Value
IsReady
Gets a flag indicating when this indicator is ready and fully initialized
public override bool IsReady { get; }
Property Value
LinearRegression
Gets the linear regression
public LeastSquaresMovingAverage LinearRegression { get; }
Property Value
LowerChannel
Gets the lower channel (linear regression - k * stdDev)
public IndicatorBase LowerChannel { get; }
Property Value
Slope
The regression line slope
public IndicatorBase Slope { get; }
Property Value
UpperChannel
Gets the upper channel (linear regression + k * stdDev)
public IndicatorBase UpperChannel { get; }
Property Value
WarmUpPeriod
Required period, in data points, for the indicator to be ready and fully initialized.
public override int WarmUpPeriod { get; }
Property Value
Methods
Forward(long, DoubleArray)
Computes the next value of this indicator from the given state
protected override DoubleArray Forward(long time, DoubleArray input)
Parameters
timelonginputDoubleArrayThe input given to the indicator
Returns
- DoubleArray
A new value for this indicator
Reset()
Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand)
public override void Reset()