Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel Class Reference

Provides an implementation of IAlphaModel that always returns the same insight for each security More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel:
[legend]

Public Member Functions

 ConstantAlphaModel (InsightType type, InsightDirection direction, TimeSpan period)
 Initializes a new instance of the ConstantAlphaModel class More...
 
 ConstantAlphaModel (InsightType type, InsightDirection direction, TimeSpan period, double? magnitude, double? confidence, double? weight=null)
 Initializes a new instance of the ConstantAlphaModel class More...
 
override IEnumerable< InsightUpdate (QCAlgorithm algorithm, Slice data)
 Creates a constant insight for each security as specified via the constructor More...
 
override void OnSecuritiesChanged (QCAlgorithm algorithm, SecurityChanges changes)
 Event fired each time the we add/remove securities from the data feed More...
 
- Public Member Functions inherited from QuantConnect.Algorithm.Framework.Alphas.AlphaModel
 AlphaModel ()
 Initialize new AlphaModel More...
 

Protected Member Functions

virtual bool ShouldEmitInsight (DateTime utcTime, Symbol symbol)
 Determine if its time to emit insight for this symbol More...
 

Additional Inherited Members

- Properties inherited from QuantConnect.Algorithm.Framework.Alphas.AlphaModel
virtual string Name [get, set]
 Defines a name for a framework model More...
 
- Properties inherited from QuantConnect.Algorithm.Framework.Alphas.INamedModel
string Name [get]
 Defines a name for a framework model More...
 

Detailed Description

Provides an implementation of IAlphaModel that always returns the same insight for each security

Definition at line 28 of file ConstantAlphaModel.cs.

Constructor & Destructor Documentation

◆ ConstantAlphaModel() [1/2]

QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel.ConstantAlphaModel ( InsightType  type,
InsightDirection  direction,
TimeSpan  period 
)

Initializes a new instance of the ConstantAlphaModel class

Parameters
typeThe type of insight
directionThe direction of the insight
periodThe period over which the insight with come to fruition

Definition at line 45 of file ConstantAlphaModel.cs.

◆ ConstantAlphaModel() [2/2]

QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel.ConstantAlphaModel ( InsightType  type,
InsightDirection  direction,
TimeSpan  period,
double?  magnitude,
double?  confidence,
double?  weight = null 
)

Initializes a new instance of the ConstantAlphaModel class

Parameters
typeThe type of insight
directionThe direction of the insight
periodThe period over which the insight with come to fruition
magnitudeThe predicted change in magnitude as a +- percentage
confidenceThe confidence in the insight
weightThe portfolio weight of the insights

Definition at line 59 of file ConstantAlphaModel.cs.

Member Function Documentation

◆ Update()

override IEnumerable<Insight> QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel.Update ( QCAlgorithm  algorithm,
Slice  data 
)
virtual

Creates a constant insight for each security as specified via the constructor

Parameters
algorithmThe algorithm instance
dataThe new data available
Returns
The new insights generated

Reimplemented from QuantConnect.Algorithm.Framework.Alphas.AlphaModel.

Definition at line 93 of file ConstantAlphaModel.cs.

Here is the call graph for this function:

◆ OnSecuritiesChanged()

override void QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel.OnSecuritiesChanged ( QCAlgorithm  algorithm,
SecurityChanges  changes 
)
virtual

Event fired each time the we add/remove securities from the data feed

Parameters
algorithmThe algorithm instance that experienced the change in securities
changesThe security additions and removals from the algorithm

Reimplemented from QuantConnect.Algorithm.Framework.Alphas.AlphaModel.

Definition at line 112 of file ConstantAlphaModel.cs.

Here is the call graph for this function:

◆ ShouldEmitInsight()

virtual bool QuantConnect.Algorithm.Framework.Alphas.ConstantAlphaModel.ShouldEmitInsight ( DateTime  utcTime,
Symbol  symbol 
)
protectedvirtual

Determine if its time to emit insight for this symbol

Parameters
utcTimeTime of the insight
symbolThe symbol to emit an insight for

Definition at line 128 of file ConstantAlphaModel.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

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