Lean  $LEAN_TAG$
QuantConnect.Indicators.DualSymbolIndicator< T > Class Template Referenceabstract

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

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

Public Member Functions

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

Protected Member Functions

 DualSymbolIndicator (string name, Symbol targetSymbol, Symbol referenceSymbol, int period)
 Initializes the dual symbol indicator. More...
 
override decimal ComputeNextValue (IBaseDataBar 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 void ComputeIndicator ()
 Performs the specific computation for the indicator. More...
 
abstract void AddDataPoint (IBaseDataBar input)
 Adds the closing price to the corresponding symbol's data set (target or reference). This method stores the data points for each symbol and performs specific calculations based on the symbol. For instance, it computes returns in the case of the Beta indicator. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.BarIndicator
 BarIndicator (string name)
 Creates a new TradeBarIndicator with the specified name More...
 

Properties

RollingWindow< T > TargetDataPoints [get]
 RollingWindow to store the data points of the target symbol More...
 
RollingWindow< T > 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...
 
bool IsTimezoneDifferent [get]
 Indicates if the time zone for the target and reference are different. 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 two different symbols and calculate an indicator based on them.

Template Parameters
TType of the data points stored in the rolling windows for each symbol (e.g., double, decimal, etc.)

Definition at line 28 of file DualSymbolIndicator.cs.

Constructor & Destructor Documentation

◆ DualSymbolIndicator()

QuantConnect.Indicators.DualSymbolIndicator< T >.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 96 of file DualSymbolIndicator.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.DualSymbolIndicator< T >.ComputeNextValue ( IBaseDataBar  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 115 of file DualSymbolIndicator.cs.

◆ ComputeIndicator()

abstract void QuantConnect.Indicators.DualSymbolIndicator< T >.ComputeIndicator ( )
protectedpure virtual

Performs the specific computation for the indicator.

Implemented in QuantConnect.Indicators.Beta, and QuantConnect.Indicators.Correlation.

Here is the caller graph for this function:

◆ AddDataPoint()

abstract void QuantConnect.Indicators.DualSymbolIndicator< T >.AddDataPoint ( IBaseDataBar  input)
protectedpure virtual

Adds the closing price to the corresponding symbol's data set (target or reference). This method stores the data points for each symbol and performs specific calculations based on the symbol. For instance, it computes returns in the case of the Beta indicator.

Parameters
inputThe input value for this symbol
Exceptions
ArgumentExceptionThrown if the input symbol does not match either the target or reference symbol.
Here is the caller graph for this function:

◆ Reset()

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

Resets this indicator to its initial state

Definition at line 203 of file DualSymbolIndicator.cs.

Property Documentation

◆ TargetDataPoints

RollingWindow<T> QuantConnect.Indicators.DualSymbolIndicator< T >.TargetDataPoints
getprotected

RollingWindow to store the data points of the target symbol

Definition at line 53 of file DualSymbolIndicator.cs.

◆ ReferenceDataPoints

RollingWindow<T> QuantConnect.Indicators.DualSymbolIndicator< T >.ReferenceDataPoints
getprotected

RollingWindow to store the data points of the reference symbol

Definition at line 58 of file DualSymbolIndicator.cs.

◆ ReferenceSymbol

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

Symbol of the reference used

Definition at line 63 of file DualSymbolIndicator.cs.

◆ TargetSymbol

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

Symbol of the target used

Definition at line 68 of file DualSymbolIndicator.cs.

◆ IsTimezoneDifferent

bool QuantConnect.Indicators.DualSymbolIndicator< T >.IsTimezoneDifferent
getprotected

Indicates if the time zone for the target and reference are different.

Definition at line 73 of file DualSymbolIndicator.cs.

◆ IndicatorValue

decimal QuantConnect.Indicators.DualSymbolIndicator< T >.IndicatorValue
getsetprotected

The most recently computed value of the indicator.

Definition at line 78 of file DualSymbolIndicator.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.DualSymbolIndicator< T >.WarmUpPeriod
getset

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

Definition at line 83 of file DualSymbolIndicator.cs.


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