Lean  $LEAN_TAG$
QuantConnect.Indicators.FunctionalIndicator< T > Class Template Reference

The functional indicator is used to lift any function into an indicator. This can be very useful when trying to combine output of several indicators, or for expression a mathematical equation More...

Inheritance diagram for QuantConnect.Indicators.FunctionalIndicator< T >:
[legend]

Public Member Functions

 FunctionalIndicator (string name, Func< T, decimal > computeNextValue, Func< IndicatorBase< T >, bool > isReady)
 Creates a new FunctionalIndicator using the specified functions as its implementation. More...
 
 FunctionalIndicator (string name, Func< T, decimal > computeNextValue, Func< IndicatorBase< T >, bool > isReady, Action reset)
 Creates a new FunctionalIndicator using the specified functions as its implementation. More...
 
override void Reset ()
 Resets this indicator to its initial state, optionally using the reset action passed via the constructor More...
 

Protected Member Functions

override decimal ComputeNextValue (T input)
 Computes the next value of this indicator from the given state More...
 

Properties

override bool IsReady [get]
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Detailed Description

The functional indicator is used to lift any function into an indicator. This can be very useful when trying to combine output of several indicators, or for expression a mathematical equation

Template Parameters
TThe input type for this indicator
Type Constraints
T :IBaseData 

Definition at line 26 of file FunctionalIndicator.cs.

Constructor & Destructor Documentation

◆ FunctionalIndicator() [1/2]

QuantConnect.Indicators.FunctionalIndicator< T >.FunctionalIndicator ( string  name,
Func< T, decimal >  computeNextValue,
Func< IndicatorBase< T >, bool >  isReady 
)

Creates a new FunctionalIndicator using the specified functions as its implementation.

Parameters
nameThe name of this indicator
computeNextValueA function accepting the input value and returning this indicator's output value
isReadyA function accepting this indicator and returning true if the indicator is ready, false otherwise

Definition at line 42 of file FunctionalIndicator.cs.

◆ FunctionalIndicator() [2/2]

QuantConnect.Indicators.FunctionalIndicator< T >.FunctionalIndicator ( string  name,
Func< T, decimal >  computeNextValue,
Func< IndicatorBase< T >, bool >  isReady,
Action  reset 
)

Creates a new FunctionalIndicator using the specified functions as its implementation.

Parameters
nameThe name of this indicator
computeNextValueA function accepting the input value and returning this indicator's output value
isReadyA function accepting this indicator and returning true if the indicator is ready, false otherwise
resetFunction called to reset this indicator and any indicators this is dependent on

Definition at line 56 of file FunctionalIndicator.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.FunctionalIndicator< T >.ComputeNextValue ( 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 77 of file FunctionalIndicator.cs.

◆ Reset()

override void QuantConnect.Indicators.FunctionalIndicator< T >.Reset ( )

Resets this indicator to its initial state, optionally using the reset action passed via the constructor

Definition at line 85 of file FunctionalIndicator.cs.

Property Documentation

◆ IsReady

override bool QuantConnect.Indicators.FunctionalIndicator< T >.IsReady
get

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 68 of file FunctionalIndicator.cs.


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