Lean
$LEAN_TAG$
|
Base class for indicators that work with two different symbols and calculate an indicator based on them. More...
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... | |
Base class for indicators that work with two different symbols and calculate an indicator based on them.
T | Type 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.
|
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.
name | The name of the indicator. |
targetSymbol | The symbol of the target asset. |
referenceSymbol | The symbol of the reference asset. |
period | The period (number of data points) over which to calculate the indicator. |
Definition at line 96 of file DualSymbolIndicator.cs.
|
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.
input | The input data point (e.g., TradeBar for a symbol). |
Definition at line 115 of file DualSymbolIndicator.cs.
|
protectedpure virtual |
Performs the specific computation for the indicator.
Implemented in QuantConnect.Indicators.Beta, and QuantConnect.Indicators.Correlation.
|
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.
input | The input value for this symbol |
ArgumentException | Thrown if the input symbol does not match either the target or reference symbol. |
override void QuantConnect.Indicators.DualSymbolIndicator< T >.Reset | ( | ) |
Resets this indicator to its initial state
Definition at line 203 of file DualSymbolIndicator.cs.
|
getprotected |
RollingWindow to store the data points of the target symbol
Definition at line 53 of file DualSymbolIndicator.cs.
|
getprotected |
RollingWindow to store the data points of the reference symbol
Definition at line 58 of file DualSymbolIndicator.cs.
|
getprotected |
Symbol of the reference used
Definition at line 63 of file DualSymbolIndicator.cs.
|
getprotected |
Symbol of the target used
Definition at line 68 of file DualSymbolIndicator.cs.
|
getprotected |
Indicates if the time zone for the target and reference are different.
Definition at line 73 of file DualSymbolIndicator.cs.
|
getsetprotected |
The most recently computed value of the indicator.
Definition at line 78 of file DualSymbolIndicator.cs.
|
getset |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 83 of file DualSymbolIndicator.cs.