Lean  $LEAN_TAG$
QuantConnect.Indicators.SqueezeMomentum Class Reference

The SqueezeMomentum indicator calculates whether the market is in a "squeeze" condition, determined by comparing Bollinger Bands to Keltner Channels. When the Bollinger Bands are inside the Keltner Channels, the indicator returns 1 (squeeze on). Otherwise, it returns -1 (squeeze off). More...

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

Public Member Functions

 SqueezeMomentum (string name, int bollingerPeriod, decimal bollingerMultiplier, int keltnerPeriod, decimal keltnerMultiplier)
 Initializes a new instance of the SqueezeMomentum class. More...
 
override void Reset ()
 Resets the state of the indicator, including all sub-indicators. More...
 

Public Attributes

override bool IsReady => BollingerBands.IsReady && KeltnerChannels.IsReady
 Indicates whether the indicator is ready and has enough data for computation. The indicator is ready when both the Bollinger Bands and the Average True Range are ready. More...
 

Protected Member Functions

override decimal ComputeNextValue (IBaseDataBar input)
 Computes the next value of the indicator based on the input data bar. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.BarIndicator
 BarIndicator (string name)
 Creates a new TradeBarIndicator with the specified name More...
 

Properties

BollingerBands BollingerBands [get]
 The Bollinger Bands indicator used to calculate the upper, lower, and middle bands. More...
 
KeltnerChannels KeltnerChannels [get]
 The Keltner Channels indicator used to calculate the upper, lower, and middle channels. More...
 
int WarmUpPeriod [get]
 Gets the warm-up period required for the indicator to be ready. This is determined by the warm-up period of the Bollinger Bands indicator. 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

The SqueezeMomentum indicator calculates whether the market is in a "squeeze" condition, determined by comparing Bollinger Bands to Keltner Channels. When the Bollinger Bands are inside the Keltner Channels, the indicator returns 1 (squeeze on). Otherwise, it returns -1 (squeeze off).

Definition at line 26 of file SqueezeMomentum.cs.

Constructor & Destructor Documentation

◆ SqueezeMomentum()

QuantConnect.Indicators.SqueezeMomentum.SqueezeMomentum ( string  name,
int  bollingerPeriod,
decimal  bollingerMultiplier,
int  keltnerPeriod,
decimal  keltnerMultiplier 
)

Initializes a new instance of the SqueezeMomentum class.

Parameters
nameThe name of the indicator.
bollingerPeriodThe period used for the Bollinger Bands calculation.
bollingerMultiplierThe multiplier for the Bollinger Bands width.
keltnerPeriodThe period used for the Average True Range (ATR) calculation in Keltner Channels.
keltnerMultiplierThe multiplier applied to the ATR for calculating Keltner Channels.

Definition at line 46 of file SqueezeMomentum.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.SqueezeMomentum.ComputeNextValue ( IBaseDataBar  input)
protected

Computes the next value of the indicator based on the input data bar.

Parameters
inputThe input data bar.
Returns
Returns 1 if the Bollinger Bands are inside the Keltner Channels (squeeze on), or -1 if the Bollinger Bands are outside the Keltner Channels (squeeze off).

Definition at line 73 of file SqueezeMomentum.cs.

◆ Reset()

override void QuantConnect.Indicators.SqueezeMomentum.Reset ( )

Resets the state of the indicator, including all sub-indicators.

Definition at line 97 of file SqueezeMomentum.cs.

Here is the call graph for this function:

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.SqueezeMomentum.IsReady => BollingerBands.IsReady && KeltnerChannels.IsReady

Indicates whether the indicator is ready and has enough data for computation. The indicator is ready when both the Bollinger Bands and the Average True Range are ready.

Definition at line 63 of file SqueezeMomentum.cs.

Property Documentation

◆ BollingerBands

BollingerBands QuantConnect.Indicators.SqueezeMomentum.BollingerBands
get

The Bollinger Bands indicator used to calculate the upper, lower, and middle bands.

Definition at line 31 of file SqueezeMomentum.cs.

◆ KeltnerChannels

KeltnerChannels QuantConnect.Indicators.SqueezeMomentum.KeltnerChannels
get

The Keltner Channels indicator used to calculate the upper, lower, and middle channels.

Definition at line 36 of file SqueezeMomentum.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.SqueezeMomentum.WarmUpPeriod
get

Gets the warm-up period required for the indicator to be ready. This is determined by the warm-up period of the Bollinger Bands indicator.

Definition at line 57 of file SqueezeMomentum.cs.


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