Lean  $LEAN_TAG$
QuantConnect.Indicators.CompositeIndicator Class Reference

This indicator is capable of wiring up two separate indicators into a single indicator such that the output of each will be sent to a user specified function. More...

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

Public Member Functions

delegate IndicatorResult IndicatorComposer (IndicatorBase left, IndicatorBase right)
 Delegate type used to compose the output of two indicators into a new value. More...
 
override void Reset ()
 Resets this indicator to its initial state More...
 
 CompositeIndicator (string name, IndicatorBase left, IndicatorBase right, IndicatorComposer composer)
 Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified More...
 
 CompositeIndicator (IndicatorBase left, IndicatorBase right, IndicatorComposer composer)
 Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified More...
 

Protected Member Functions

override IndicatorResult ValidateAndComputeNextValue (IndicatorDataPoint input)
 Computes the next value of this indicator from the given state and returns an instance of the IndicatorResult class More...
 
override decimal ComputeNextValue (IndicatorDataPoint _)
 Computes the next value of this indicator from the given state More...
 

Properties

IndicatorBase Left [get]
 Gets the 'left' indicator for the delegate More...
 
IndicatorBase Right [get]
 Gets the 'right' indicator for the delegate More...
 
override bool IsReady [get]
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Detailed Description

This indicator is capable of wiring up two separate indicators into a single indicator such that the output of each will be sent to a user specified function.

This type is initialized such that there is no need to call the Update function. This indicator will have its values automatically updated each time a new piece of data is received from both the left and right indicators.

Definition at line 29 of file CompositeIndicator.cs.

Constructor & Destructor Documentation

◆ CompositeIndicator() [1/2]

QuantConnect.Indicators.CompositeIndicator.CompositeIndicator ( string  name,
IndicatorBase  left,
IndicatorBase  right,
IndicatorComposer  composer 
)

Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified

Parameters
nameThe name of this indicator
leftThe left indicator for the 'composer'
rightThe right indicator for the 'composer'
composerFunction used to compose the left and right indicators

Definition at line 81 of file CompositeIndicator.cs.

◆ CompositeIndicator() [2/2]

QuantConnect.Indicators.CompositeIndicator.CompositeIndicator ( IndicatorBase  left,
IndicatorBase  right,
IndicatorComposer  composer 
)

Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified

Parameters
leftThe left indicator for the 'composer'
rightThe right indicator for the 'composer'
composerFunction used to compose the left and right indicators

Definition at line 97 of file CompositeIndicator.cs.

Member Function Documentation

◆ IndicatorComposer()

delegate IndicatorResult QuantConnect.Indicators.CompositeIndicator.IndicatorComposer ( IndicatorBase  left,
IndicatorBase  right 
)

Delegate type used to compose the output of two indicators into a new value.

A simple example would be to compute the difference between the two indicators (such as with MACD) (left, right) => left - right

Parameters
leftThe left indicator
rightThe right indicator
Returns
And indicator result representing the composition of the two indicators

◆ Reset()

override void QuantConnect.Indicators.CompositeIndicator.Reset ( )

Resets this indicator to its initial state

Definition at line 67 of file CompositeIndicator.cs.

Here is the caller graph for this function:

◆ ValidateAndComputeNextValue()

override IndicatorResult QuantConnect.Indicators.CompositeIndicator.ValidateAndComputeNextValue ( IndicatorDataPoint  input)
protected

Computes the next value of this indicator from the given state and returns an instance of the IndicatorResult class

Parameters
inputThe input given to the indicator
Returns
An IndicatorResult object including the status of the indicator

Definition at line 107 of file CompositeIndicator.cs.

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.CompositeIndicator.ComputeNextValue ( IndicatorDataPoint  _)
protected

Computes the next value of this indicator from the given state

Since this class overrides ValidateAndComputeNextValue, this method is a no-op

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

Definition at line 120 of file CompositeIndicator.cs.

Property Documentation

◆ Left

IndicatorBase QuantConnect.Indicators.CompositeIndicator.Left
get

Gets the 'left' indicator for the delegate

Definition at line 49 of file CompositeIndicator.cs.

◆ Right

IndicatorBase QuantConnect.Indicators.CompositeIndicator.Right
get

Gets the 'right' indicator for the delegate

Definition at line 54 of file CompositeIndicator.cs.

◆ IsReady

override bool QuantConnect.Indicators.CompositeIndicator.IsReady
get

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

Definition at line 60 of file CompositeIndicator.cs.


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