Lean
$LEAN_TAG$
|
Defines a custom alpha model that uses MACD crossovers. The MACD signal line is used to generate up/down insights if it's stronger than the bounce threshold. If the MACD signal is within the bounce threshold then a flat price insight is returned. More...
Classes | |
class | SymbolData |
Public Member Functions | |
MacdAlphaModel (int fastPeriod=12, int slowPeriod=26, int signalPeriod=9, MovingAverageType movingAverageType=MovingAverageType.Exponential, Resolution resolution=Resolution.Daily) | |
Initializes a new instance of the MacdAlphaModel class More... | |
override IEnumerable< Insight > | Update (QCAlgorithm algorithm, Slice data) |
Determines an insight for each security based on it's current MACD signal More... | |
override void | OnSecuritiesChanged (QCAlgorithm algorithm, SecurityChanges changes) |
Event fired each time the we add/remove securities from the data feed. This initializes the MACD for each added security and cleans up the indicator for each removed security. More... | |
Public Member Functions inherited from QuantConnect.Algorithm.Framework.Alphas.AlphaModel | |
AlphaModel () | |
Initialize new AlphaModel More... | |
Protected Attributes | |
readonly Dictionary< Symbol, SymbolData > | _symbolData |
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... | |
Defines a custom alpha model that uses MACD crossovers. The MACD signal line is used to generate up/down insights if it's stronger than the bounce threshold. If the MACD signal is within the bounce threshold then a flat price insight is returned.
Definition at line 31 of file MacdAlphaModel.cs.
QuantConnect.Algorithm.Framework.Alphas.MacdAlphaModel.MacdAlphaModel | ( | int | fastPeriod = 12 , |
int | slowPeriod = 26 , |
||
int | signalPeriod = 9 , |
||
MovingAverageType | movingAverageType = MovingAverageType.Exponential , |
||
Resolution | resolution = Resolution.Daily |
||
) |
Initializes a new instance of the MacdAlphaModel class
fastPeriod | The MACD fast period |
slowPeriod | The MACD slow period |
signalPeriod | The smoothing period for the MACD signal |
movingAverageType | The type of moving average to use in the MACD |
resolution | The resolution of data sent into the MACD indicator |
Definition at line 50 of file MacdAlphaModel.cs.
|
virtual |
Determines an insight for each security based on it's current MACD signal
algorithm | The algorithm instance |
data | The new data available |
Reimplemented from QuantConnect.Algorithm.Framework.Alphas.AlphaModel.
Definition at line 73 of file MacdAlphaModel.cs.
|
virtual |
Event fired each time the we add/remove securities from the data feed. This initializes the MACD for each added security and cleans up the indicator for each removed security.
algorithm | The algorithm instance that experienced the change in securities |
changes | The security additions and removals from the algorithm |
Reimplemented from QuantConnect.Algorithm.Framework.Alphas.AlphaModel.
Definition at line 121 of file MacdAlphaModel.cs.