Lean  $LEAN_TAG$
QuantConnect.Indicators.MultiSymbolIndicator< TInput > Class Template Referenceabstract

Base class for indicators that work with multiple different symbols. More...

Inheritance diagram for QuantConnect.Indicators.MultiSymbolIndicator< TInput >:
[legend]

Classes

class  SymbolData
 Contains the data points, the current input and other relevant indicator data for a symbol. More...
 

Public Member Functions

override void Reset ()
 Resets this indicator to its initial state More...
 

Public Attributes

override bool IsReady => DataBySymbol.Values.All(data => data.DataPoints.IsReady)
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Protected Member Functions

 MultiSymbolIndicator (string name, IEnumerable< Symbol > symbols, int period)
 Initializes the dual symbol indicator. More...
 
override decimal ComputeNextValue (TInput input)
 Checks and computes the indicator if the input data matches. This method ensures the input data points are from matching time periods and different symbols. More...
 
abstract decimal ComputeIndicator ()
 Computes the next value of this indicator from the given state. This will be called only when the indicator is ready, that is, when data for all symbols at a given time is available. More...
 

Properties

Dictionary< Symbol, SymbolDataDataBySymbol [get]
 Relevant data for each symbol the indicator works on, including all inputs and actual data points used for calculation. More...
 
decimal IndicatorValue [get, set]
 The most recently computed value of the indicator. More...
 
int WarmUpPeriod [get, set]
 Required period, in data points, for the indicator to be ready and fully initialized. 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

Base class for indicators that work with multiple different symbols.

Template Parameters
TInputIndicator input data type
Type Constraints
TInput :IBaseData 

Definition at line 29 of file MultiSymbolIndicator.cs.

Constructor & Destructor Documentation

◆ MultiSymbolIndicator()

QuantConnect.Indicators.MultiSymbolIndicator< TInput >.MultiSymbolIndicator ( string  name,
IEnumerable< Symbol symbols,
int  period 
)
protected

Initializes the dual symbol indicator.

The constructor accepts a target symbol and a reference symbol. It also initializes the time zones for both symbols and checks if they are different.

Parameters
nameThe name of the indicator.
symbolsThe symbols the indicator works on .
periodThe period (number of data points) over which to calculate the indicator.

Definition at line 63 of file MultiSymbolIndicator.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.MultiSymbolIndicator< TInput >.ComputeNextValue ( TInput  input)
protected

Checks and computes the indicator if the input data matches. This method ensures the input data points are from matching time periods and different symbols.

Parameters
inputThe input data point (e.g., TradeBar for a symbol).
Returns
The most recently computed value of the indicator.

Definition at line 77 of file MultiSymbolIndicator.cs.

◆ ComputeIndicator()

abstract decimal QuantConnect.Indicators.MultiSymbolIndicator< TInput >.ComputeIndicator ( )
protectedpure virtual

Computes the next value of this indicator from the given state. This will be called only when the indicator is ready, that is, when data for all symbols at a given time is available.

Implemented in QuantConnect.Indicators.ImpliedVolatility, and QuantConnect.Indicators.OptionGreeksIndicatorBase.

Here is the caller graph for this function:

◆ Reset()

override void QuantConnect.Indicators.MultiSymbolIndicator< TInput >.Reset ( )

Resets this indicator to its initial state

Definition at line 117 of file MultiSymbolIndicator.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.MultiSymbolIndicator< TInput >.IsReady => DataBySymbol.Values.All(data => data.DataPoints.IsReady)

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

Definition at line 51 of file MultiSymbolIndicator.cs.

Property Documentation

◆ DataBySymbol

Dictionary<Symbol, SymbolData> QuantConnect.Indicators.MultiSymbolIndicator< TInput >.DataBySymbol
getprotected

Relevant data for each symbol the indicator works on, including all inputs and actual data points used for calculation.

Definition at line 36 of file MultiSymbolIndicator.cs.

◆ IndicatorValue

decimal QuantConnect.Indicators.MultiSymbolIndicator< TInput >.IndicatorValue
getsetprotected

The most recently computed value of the indicator.

Definition at line 41 of file MultiSymbolIndicator.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.MultiSymbolIndicator< TInput >.WarmUpPeriod
getset

Required period, in data points, for the indicator to be ready and fully initialized.

Definition at line 46 of file MultiSymbolIndicator.cs.


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