Lean
$LEAN_TAG$
|
This indicator computes the Triangular Moving Average (TRIMA). The Triangular Moving Average is calculated with the following formula: (1) When the period is even, TRIMA(x,period)=SMA(SMA(x,period/2),(period/2)+1) (2) When the period is odd, TRIMA(x,period)=SMA(SMA(x,(period+1)/2),(period+1)/2) More...
Public Member Functions | |
TriangularMovingAverage (string name, int period) | |
Initializes a new instance of the TriangularMovingAverage class using the specified name and period. More... | |
TriangularMovingAverage (int period) | |
Initializes a new instance of the TriangularMovingAverage class using the specified period. More... | |
override void | Reset () |
Resets this indicator to its initial state More... | |
Public Attributes | |
override bool | IsReady => Samples >= _period |
Gets a flag indicating when this indicator is ready and fully initialized More... | |
int | WarmUpPeriod => _period |
Required period, in data points, for the indicator to be ready and fully initialized. More... | |
Protected Member Functions | |
override decimal | ComputeNextValue (IndicatorDataPoint input) |
Computes the next value of this indicator from the given state More... | |
Protected Member Functions inherited from QuantConnect.Indicators.Indicator | |
Indicator (string name) | |
Initializes a new instance of the Indicator class using the specified name. More... | |
Additional Inherited Members | |
Properties inherited from QuantConnect.Indicators.Indicator | |
static int | DefaultWindowSize = 2 [get] |
The default size of the history window for the indicator More... | |
Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider | |
int | WarmUpPeriod [get] |
Required period, in data points, for the indicator to be ready and fully initialized. More... | |
This indicator computes the Triangular Moving Average (TRIMA). The Triangular Moving Average is calculated with the following formula: (1) When the period is even, TRIMA(x,period)=SMA(SMA(x,period/2),(period/2)+1) (2) When the period is odd, TRIMA(x,period)=SMA(SMA(x,(period+1)/2),(period+1)/2)
Definition at line 24 of file TriangularMovingAverage.cs.
QuantConnect.Indicators.TriangularMovingAverage.TriangularMovingAverage | ( | string | name, |
int | period | ||
) |
Initializes a new instance of the TriangularMovingAverage class using the specified name and period.
name | The name of this indicator |
period | The period of the indicator |
Definition at line 35 of file TriangularMovingAverage.cs.
QuantConnect.Indicators.TriangularMovingAverage.TriangularMovingAverage | ( | int | period | ) |
Initializes a new instance of the TriangularMovingAverage class using the specified period.
period | The period of the indicator |
Definition at line 51 of file TriangularMovingAverage.cs.
|
protected |
Computes the next value of this indicator from the given state
input | The input given to the indicator |
Definition at line 71 of file TriangularMovingAverage.cs.
override void QuantConnect.Indicators.TriangularMovingAverage.Reset | ( | ) |
Resets this indicator to its initial state
Definition at line 82 of file TriangularMovingAverage.cs.
override bool QuantConnect.Indicators.TriangularMovingAverage.IsReady => Samples >= _period |
Gets a flag indicating when this indicator is ready and fully initialized
Definition at line 59 of file TriangularMovingAverage.cs.
int QuantConnect.Indicators.TriangularMovingAverage.WarmUpPeriod => _period |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 64 of file TriangularMovingAverage.cs.