|
Lean
$LEAN_TAG$
|
The Correlation Indicator is a valuable tool in technical analysis, designed to quantify the degree of relationship between the price movements of a target security (e.g., a stock or ETF) and a reference market index. It measures how closely the target’s price changes are aligned with the fluctuations of the index over a specific period of time, providing insights into the target’s susceptibility to market movements. A positive correlation indicates that the target tends to move in the same direction as the market index, while a negative correlation suggests an inverse relationship. A correlation close to 0 implies a weak or no linear relationship. Commonly, the SPX index is employed as the benchmark for the overall market when calculating correlation, ensuring a consistent and reliable reference point. This helps traders and investors make informed decisions regarding the risk and behavior of the target security in relation to market trends. More...
Public Member Functions | |
| Correlation (string name, Symbol targetSymbol, Symbol referenceSymbol, int period, CorrelationType correlationType=CorrelationType.Pearson) | |
| Creates a new Correlation indicator with the specified name, target, reference, and period values More... | |
| Correlation (Symbol targetSymbol, Symbol referenceSymbol, int period, CorrelationType correlationType=CorrelationType.Pearson) | |
| Creates a new Correlation indicator with the specified target, reference, and period values More... | |
Public Attributes | |
| override bool | IsReady => TargetDataPoints.IsReady && ReferenceDataPoints.IsReady |
| Gets a flag indicating when the indicator is ready and fully initialized More... | |
Protected Member Functions | |
| override decimal | ComputeIndicator () |
| Computes the correlation value usuing symbols values correlation values assing into _correlation property More... | |
Protected Member Functions inherited from QuantConnect.Indicators.DualSymbolIndicator< IBaseDataBar > | |
| DualSymbolIndicator (string name, Symbol targetSymbol, Symbol referenceSymbol, int period) | |
| Initializes the dual symbol indicator. More... | |
Additional Inherited Members | |
Properties inherited from QuantConnect.Indicators.DualSymbolIndicator< IBaseDataBar > | |
| 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... | |
The Correlation Indicator is a valuable tool in technical analysis, designed to quantify the degree of relationship between the price movements of a target security (e.g., a stock or ETF) and a reference market index. It measures how closely the target’s price changes are aligned with the fluctuations of the index over a specific period of time, providing insights into the target’s susceptibility to market movements. A positive correlation indicates that the target tends to move in the same direction as the market index, while a negative correlation suggests an inverse relationship. A correlation close to 0 implies a weak or no linear relationship. Commonly, the SPX index is employed as the benchmark for the overall market when calculating correlation, ensuring a consistent and reliable reference point. This helps traders and investors make informed decisions regarding the risk and behavior of the target security in relation to market trends.
The indicator only updates when both assets have a price for a time step. When a bar is missing for one of the assets, the indicator value fills forward to improve the accuracy of the indicator.
Definition at line 39 of file Correlation.cs.
| QuantConnect.Indicators.Correlation.Correlation | ( | string | name, |
| Symbol | targetSymbol, | ||
| Symbol | referenceSymbol, | ||
| int | period, | ||
| CorrelationType | correlationType = CorrelationType.Pearson |
||
| ) |
Creates a new Correlation indicator with the specified name, target, reference, and period values
| name | The name of this indicator |
| targetSymbol | The target symbol of this indicator |
| period | The period of this indicator |
| referenceSymbol | The reference symbol of this indicator |
| correlationType | Correlation type |
Definition at line 60 of file Correlation.cs.
| QuantConnect.Indicators.Correlation.Correlation | ( | Symbol | targetSymbol, |
| Symbol | referenceSymbol, | ||
| int | period, | ||
| CorrelationType | correlationType = CorrelationType.Pearson |
||
| ) |
Creates a new Correlation indicator with the specified target, reference, and period values
| targetSymbol | The target symbol of this indicator |
| period | The period of this indicator |
| referenceSymbol | The reference symbol of this indicator |
| correlationType | Correlation type |
Definition at line 79 of file Correlation.cs.
|
protected |
Computes the correlation value usuing symbols values correlation values assing into _correlation property
Definition at line 88 of file Correlation.cs.
| override bool QuantConnect.Indicators.Correlation.IsReady => TargetDataPoints.IsReady && ReferenceDataPoints.IsReady |
Gets a flag indicating when the indicator is ready and fully initialized
Definition at line 49 of file Correlation.cs.