Lean  $LEAN_TAG$
QuantConnect.Indicators.MidPrice Class Reference

This indicator computes the MidPrice (MIDPRICE). The MidPrice is calculated using the following formula: MIDPRICE = (Highest High + Lowest Low) / 2 More...

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

Public Member Functions

 MidPrice (string name, int period)
 Initializes a new instance of the MidPrice class using the specified name and period. More...
 
 MidPrice (int period)
 Initializes a new instance of the MidPrice class using the specified period. More...
 

Public Attributes

override bool IsReady => Samples >= _period
 Gets a flag indicating when this indicator is ready and fully initialized More...
 
int WarmUpPeriod => _period
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Protected Member Functions

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

Additional Inherited Members

- 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 computes the MidPrice (MIDPRICE). The MidPrice is calculated using the following formula: MIDPRICE = (Highest High + Lowest Low) / 2

Definition at line 25 of file MidPrice.cs.

Constructor & Destructor Documentation

◆ MidPrice() [1/2]

QuantConnect.Indicators.MidPrice.MidPrice ( string  name,
int  period 
)

Initializes a new instance of the MidPrice class using the specified name and period.

Parameters
nameThe name of this indicator
periodThe period of the MIDPRICE

Definition at line 36 of file MidPrice.cs.

◆ MidPrice() [2/2]

QuantConnect.Indicators.MidPrice.MidPrice ( int  period)

Initializes a new instance of the MidPrice class using the specified period.

Parameters
periodThe period of the MIDPRICE

Definition at line 48 of file MidPrice.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.MidPrice.ComputeNextValue ( IBaseDataBar  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 68 of file MidPrice.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.MidPrice.IsReady => Samples >= _period

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 56 of file MidPrice.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.MidPrice.WarmUpPeriod => _period

Required period, in data points, for the indicator to be ready and fully initialized.

Definition at line 61 of file MidPrice.cs.


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