Lean  $LEAN_TAG$
QuantConnect.Indicators.DualSymbolIndicator< TInput > Class Template Reference

Base class for indicators that work with two different symbols and calculate an indicator based on them. More...

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

Protected Member Functions

 DualSymbolIndicator (string name, Symbol targetSymbol, Symbol referenceSymbol, int period)
 Initializes the dual symbol indicator. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.MultiSymbolIndicator< TInput >
 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

IReadOnlyWindow< TInput > TargetDataPoints [get]
 RollingWindow to store the data points of the target symbol More...
 
IReadOnlyWindow< TInput > ReferenceDataPoints [get]
 RollingWindow to store the data points of the reference symbol More...
 
Symbol ReferenceSymbol [get]
 Symbol of the reference used More...
 
Symbol TargetSymbol [get]
 Symbol of the target used More...
 
- Properties inherited from QuantConnect.Indicators.MultiSymbolIndicator< TInput >
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...
 

Additional Inherited Members

- Public Member Functions inherited from QuantConnect.Indicators.MultiSymbolIndicator< TInput >
override void Reset ()
 Resets this indicator to its initial state More...
 
- Public Attributes inherited from QuantConnect.Indicators.MultiSymbolIndicator< TInput >
override bool IsReady => DataBySymbol.Values.All(data => data.DataPoints.IsReady)
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Detailed Description

Base class for indicators that work with two different symbols and calculate an indicator based on them.

Template Parameters
TInputIndicator input data type
Type Constraints
TInput :IBaseData 

Definition at line 24 of file DualSymbolIndicator.cs.

Constructor & Destructor Documentation

◆ DualSymbolIndicator()

QuantConnect.Indicators.DualSymbolIndicator< TInput >.DualSymbolIndicator ( string  name,
Symbol  targetSymbol,
Symbol  referenceSymbol,
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.
targetSymbolThe symbol of the target asset.
referenceSymbolThe symbol of the reference asset.
periodThe period (number of data points) over which to calculate the indicator.

Definition at line 58 of file DualSymbolIndicator.cs.

Property Documentation

◆ TargetDataPoints

IReadOnlyWindow<TInput> QuantConnect.Indicators.DualSymbolIndicator< TInput >.TargetDataPoints
getprotected

RollingWindow to store the data points of the target symbol

Definition at line 30 of file DualSymbolIndicator.cs.

◆ ReferenceDataPoints

IReadOnlyWindow<TInput> QuantConnect.Indicators.DualSymbolIndicator< TInput >.ReferenceDataPoints
getprotected

RollingWindow to store the data points of the reference symbol

Definition at line 35 of file DualSymbolIndicator.cs.

◆ ReferenceSymbol

Symbol QuantConnect.Indicators.DualSymbolIndicator< TInput >.ReferenceSymbol
getprotected

Symbol of the reference used

Definition at line 40 of file DualSymbolIndicator.cs.

◆ TargetSymbol

Symbol QuantConnect.Indicators.DualSymbolIndicator< TInput >.TargetSymbol
getprotected

Symbol of the target used

Definition at line 45 of file DualSymbolIndicator.cs.


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