|
Lean
$LEAN_TAG$
|
Base class for indicators that work with two different symbols and calculate an indicator based on them. More...
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, SymbolData > | DataBySymbol [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... | |
Base class for indicators that work with two different symbols and calculate an indicator based on them.
| TInput | Indicator input data type |
| TInput | : | IBaseData |
Definition at line 24 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 58 of file DualSymbolIndicator.cs.
|
getprotected |
RollingWindow to store the data points of the target symbol
Definition at line 30 of file DualSymbolIndicator.cs.
|
getprotected |
RollingWindow to store the data points of the reference symbol
Definition at line 35 of file DualSymbolIndicator.cs.
|
getprotected |
Symbol of the reference used
Definition at line 40 of file DualSymbolIndicator.cs.
|
getprotected |
Symbol of the target used
Definition at line 45 of file DualSymbolIndicator.cs.