Lean  $LEAN_TAG$
QuantConnect.Indicators.WilderSwingIndex Class Reference

This indicator calculates the Swing Index (SI) as defined by Welles Wilder in his book 'New Concepts in Technical Trading Systems'. More...

Inheritance diagram for QuantConnect.Indicators.WilderSwingIndex:
[legend]

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...
 

Detailed Description

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

  1. |Hₜ - Cₜ₋₁| => |Hₜ - Cₜ| - 0.5 * |Lₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|
  2. |Lₜ - Cₜ₋₁| => |Lₜ - Cₜ| - 0.5 * |Hₜ - Cₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|
  3. |Hₜ - Lₜ| => |Hₜ - Lₜ₋₁| + 0.25 * |Cₜ₋₁ - Oₜ₋₁|

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

See also
WilderAccumulativeSwingIndex

Definition at line 94 of file WilderSwingIndex.cs.

Constructor & Destructor Documentation

◆ WilderSwingIndex() [1/2]

QuantConnect.Indicators.WilderSwingIndex.WilderSwingIndex ( string  name,
decimal  limitMove 
)

Initializes a new instance of the WilderSwingIndex class using the specified name.

Parameters
nameA string for the name of this indicator.
limitMoveA decimal representing the limit move value for the period.

Definition at line 116 of file WilderSwingIndex.cs.

◆ WilderSwingIndex() [2/2]

QuantConnect.Indicators.WilderSwingIndex.WilderSwingIndex ( decimal  limitMove)

Initializes a new instance of the WilderSwingIndex class using the default name.

Parameters
limitMoveA decimal representing the limit move value for the period.

Definition at line 126 of file WilderSwingIndex.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.WilderSwingIndex.ComputeNextValue ( TradeBar  input)
protected

Computes the next value of this indicator from the given state.

Parameters
inputThe input given to the indicator.
Returns
A new value for this indicator.

Definition at line 146 of file WilderSwingIndex.cs.

Member Data Documentation

◆ IsReady

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.

◆ WarmUpPeriod

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.

Property Documentation

◆ _currentInput

IBaseDataBar QuantConnect.Indicators.WilderSwingIndex._currentInput
getprotected

Holds the bar for the current period.

Definition at line 99 of file WilderSwingIndex.cs.

◆ _previousInput

IBaseDataBar QuantConnect.Indicators.WilderSwingIndex._previousInput
getprotected

Holds the bar for the previous period.

Definition at line 104 of file WilderSwingIndex.cs.


The documentation for this class was generated from the following file: