Lean
$LEAN_TAG$
|
In technical analysis Beta indicator is used to measure volatility or risk of a target (ETF) relative to the overall risk (volatility) of the reference (market indexes). The Beta indicators compares target's price movement to the movements of the indexes over the same period of time. More...
Public Member Functions | |
Beta (string name, Symbol targetSymbol, Symbol referenceSymbol, int period) | |
Creates a new Beta indicator with the specified name, target, reference, and period values More... | |
Beta (Symbol targetSymbol, Symbol referenceSymbol, int period) | |
Creates a new Beta indicator with the specified target, reference, and period values More... | |
Beta (string name, int period, Symbol targetSymbol, Symbol referenceSymbol) | |
Creates a new Beta indicator with the specified name, period, target and reference values More... | |
override void | Reset () |
Resets this indicator to its initial state More... | |
![]() | |
override void | Reset () |
Resets this indicator to its initial state More... | |
Public Attributes | |
override bool | IsReady => _targetReturns.IsReady && _referenceReturns.IsReady |
Gets a flag indicating when the indicator is ready and fully initialized More... | |
Protected Member Functions | |
override void | AddDataPoint (IBaseDataBar input) |
Adds the closing price to the corresponding symbol's data set (target or reference). Computes returns when there are enough data points for each symbol. More... | |
override void | ComputeIndicator () |
Computes the beta value of the target in relation with the reference using the target and reference returns More... | |
![]() | |
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 | 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... | |
Additional Inherited Members | |
![]() | |
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... | |
In technical analysis Beta indicator is used to measure volatility or risk of a target (ETF) relative to the overall risk (volatility) of the reference (market indexes). The Beta indicators compares target's price movement to the movements of the indexes over the same period of time.
It is common practice to use the SPX index as a benchmark of the overall reference market when it comes to Beta calculations.
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.
QuantConnect.Indicators.Beta.Beta | ( | string | name, |
Symbol | targetSymbol, | ||
Symbol | referenceSymbol, | ||
int | period | ||
) |
Creates a new Beta 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 |
QuantConnect.Indicators.Beta.Beta | ( | string | name, |
int | period, | ||
Symbol | targetSymbol, | ||
Symbol | referenceSymbol | ||
) |
Creates a new Beta indicator with the specified name, period, target and reference values
name | The name of this indicator |
period | The period of this indicator |
targetSymbol | The target symbol of this indicator |
referenceSymbol | The reference symbol of this indicator |
Constructor overload for backward compatibility.
|
protected |
|
protectedvirtual |
Computes the beta value of the target in relation with the reference using the target and reference returns
Implements QuantConnect.Indicators.DualSymbolIndicator< decimal >.
override void QuantConnect.Indicators.Beta.Reset | ( | ) |
override bool QuantConnect.Indicators.Beta.IsReady => _targetReturns.IsReady && _referenceReturns.IsReady |