Dividend Yield
Supported Models
Introduction
This page describes all of the pre-built dividend yield models in LEAN. If none of these models perform exactly how you want, create a custom dividend yield model.
Constant Model
The ConstantDividendYieldModel
returns a constant yield across time. It's the default dividend yield model for securities that don't pay dividends.
_dividendYieldModel = new ConstantDividendYieldModel(0.02m);
self.dividend_yield_model = ConstantDividendYieldModel(0.02)
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
dividendYield dividend_yield | decimal float | The dividend yield |
To view the implementation of this model, see the LEAN GitHub repository.
Dividend Yield Provider Model
The DividendYieldProvider
uses historical dividend payments to estimate the annualized continuous dividend yield for a given date.
_dividendYieldModel = new DividendYieldProvider();
self.dividend_yield_model = DividendYieldProvider()
The following table describes the arguments the model accepts:
Argument | Data Type | Description | Default Value |
---|---|---|---|
symbol | Symbol | The symbol of a dividend-paying security. If you don't provide a value, it defaults to SPY. |
To view the implementation of this model, see the LEAN GitHub repository.