Lean  $LEAN_TAG$
QuantConnect.Indicators.TriangularMovingAverage Class Reference

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...

Inheritance diagram for QuantConnect.Indicators.TriangularMovingAverage:
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TriangularMovingAverage() [1/2]

QuantConnect.Indicators.TriangularMovingAverage.TriangularMovingAverage ( string  name,
int  period 
)

Initializes a new instance of the TriangularMovingAverage class using the specified name and period.

Parameters
nameThe name of this indicator
periodThe period of the indicator

Definition at line 35 of file TriangularMovingAverage.cs.

◆ TriangularMovingAverage() [2/2]

QuantConnect.Indicators.TriangularMovingAverage.TriangularMovingAverage ( int  period)

Initializes a new instance of the TriangularMovingAverage class using the specified period.

Parameters
periodThe period of the indicator

Definition at line 51 of file TriangularMovingAverage.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.TriangularMovingAverage.ComputeNextValue ( IndicatorDataPoint  input)
protected

Computes the next value of this indicator from the given state

Parameters
inputThe input given to the indicator
Returns
A new value for this indicator

Definition at line 71 of file TriangularMovingAverage.cs.

◆ Reset()

override void QuantConnect.Indicators.TriangularMovingAverage.Reset ( )

Resets this indicator to its initial state

Definition at line 82 of file TriangularMovingAverage.cs.

Member Data Documentation

◆ IsReady

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.

◆ WarmUpPeriod

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.


The documentation for this class was generated from the following file: