Lean
$LEAN_TAG$
|
This indicator calculates the Swing Index (SI) as defined by Welles Wilder in his book 'New Concepts in Technical Trading Systems'. More...
Public Member Functions | |
WilderSwingIndex (string name, decimal limitMove) | |
Initializes a new instance of the WilderSwingIndex class using the specified name. More... | |
WilderSwingIndex (decimal limitMove) | |
Initializes a new instance of the WilderSwingIndex class using the default name. More... | |
Public Attributes | |
override bool | IsReady => Samples > 1 |
Gets a flag indicating when this indicator is ready and fully initialized. More... | |
int | WarmUpPeriod => 2 |
Required period, in data points, for the indicator to be ready and fully initialized. More... | |
Protected Member Functions | |
override decimal | ComputeNextValue (TradeBar input) |
Computes the next value of this indicator from the given state. More... | |
Protected Member Functions inherited from QuantConnect.Indicators.TradeBarIndicator | |
TradeBarIndicator (string name) | |
Creates a new TradeBarIndicator with the specified name More... | |
Properties | |
IBaseDataBar | _currentInput [get] |
Holds the bar for the current period. More... | |
IBaseDataBar | _previousInput [get] |
Holds the bar for the previous period. 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... | |
This indicator calculates the Swing Index (SI) as defined by Welles Wilder in his book 'New Concepts in Technical Trading Systems'.
SIₜ = 50 * ( N / R ) * ( K / T )
Where:
N Equals: Cₜ - Cₜ₋₁ + 0.5 * (Cₜ - Oₜ) + 0.25 * (Cₜ₋₁ - Oₜ₋₁)
See GetNValue
R Found by selecting the expression with the largest value and then using the corresponding formula.
Expression => Formula
See GetRValue
K Found by selecting the larger of the two expressions: |Hₜ - Cₜ₋₁|, |Lₜ - Cₜ₋₁|
See GetKValue
T The limit move, or the maximum change in price during the time period for the bar. Passed as limitMove via the constructor.
See T
Definition at line 94 of file WilderSwingIndex.cs.
QuantConnect.Indicators.WilderSwingIndex.WilderSwingIndex | ( | string | name, |
decimal | limitMove | ||
) |
Initializes a new instance of the WilderSwingIndex class using the specified name.
name | A string for the name of this indicator. |
limitMove | A decimal representing the limit move value for the period. |
Definition at line 116 of file WilderSwingIndex.cs.
QuantConnect.Indicators.WilderSwingIndex.WilderSwingIndex | ( | decimal | limitMove | ) |
Initializes a new instance of the WilderSwingIndex class using the default name.
limitMove | A decimal representing the limit move value for the period. |
Definition at line 126 of file WilderSwingIndex.cs.
|
protected |
Computes the next value of this indicator from the given state.
input | The input given to the indicator. |
Definition at line 146 of file WilderSwingIndex.cs.
override bool QuantConnect.Indicators.WilderSwingIndex.IsReady => Samples > 1 |
Gets a flag indicating when this indicator is ready and fully initialized.
Definition at line 134 of file WilderSwingIndex.cs.
int QuantConnect.Indicators.WilderSwingIndex.WarmUpPeriod => 2 |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 139 of file WilderSwingIndex.cs.
|
getprotected |
Holds the bar for the current period.
Definition at line 99 of file WilderSwingIndex.cs.
|
getprotected |
Holds the bar for the previous period.
Definition at line 104 of file WilderSwingIndex.cs.