Lean  $LEAN_TAG$
QuantConnect.Data.DividendYieldProvider Class Reference

Estimated annualized continuous dividend yield at given date More...

Inheritance diagram for QuantConnect.Data.DividendYieldProvider:
[legend]

Public Member Functions

 DividendYieldProvider ()
 Creates a new instance using the default symbol More...
 
 DividendYieldProvider (Symbol symbol)
 Instantiates a DividendYieldProvider with the specified Symbol More...
 
decimal GetDividendYield (DateTime date)
 Get dividend yield by a given date of a given symbol. It will get the dividend yield at the time of the most recent dividend since no price is provided. In order to get more accurate dividend yield, provide the security price at the given date to the GetDividendYield(DateTime, decimal) or GetDividendYield(IBaseData) methods. More...
 
decimal GetDividendYield (IBaseData priceData)
 Gets the dividend yield at the date of the specified data, using the data price as the security price More...
 
decimal GetDividendYield (DateTime date, decimal securityPrice)
 Get dividend yield at given date and security price More...
 

Static Public Member Functions

static IDividendYieldModel CreateForOption (Symbol optionSymbol)
 Creates a new instance for the given option symbol More...
 

Static Public Attributes

static readonly decimal DefaultDividendYieldRate = 0.0m
 Default no dividend payout More...
 

Protected Member Functions

virtual List< BaseDataLoadCorporateEvents (Symbol symbol)
 Generate the corporate events from the corporate factor file for the specified symbol More...
 

Static Protected Attributes

static Dictionary< Symbol, List< BaseData > > _corporateEventsCache
 The dividends by symbol More...
 
static Task _cacheClearTask
 Task to clear the cache More...
 

Properties

static Symbol DefaultSymbol = Symbol.Create("SPY", SecurityType.Equity, QuantConnect.Market.USA) [get, set]
 The default symbol to use as a dividend yield provider More...
 
virtual TimeSpan CacheRefreshPeriod [get]
 The cached refresh period for the dividend yield rate More...
 

Detailed Description

Estimated annualized continuous dividend yield at given date

Definition at line 31 of file DividendYieldProvider.cs.

Constructor & Destructor Documentation

◆ DividendYieldProvider() [1/2]

QuantConnect.Data.DividendYieldProvider.DividendYieldProvider ( )

Creates a new instance using the default symbol

Definition at line 82 of file DividendYieldProvider.cs.

Here is the caller graph for this function:

◆ DividendYieldProvider() [2/2]

QuantConnect.Data.DividendYieldProvider.DividendYieldProvider ( Symbol  symbol)

Instantiates a DividendYieldProvider with the specified Symbol

Definition at line 89 of file DividendYieldProvider.cs.

Here is the call graph for this function:

Member Function Documentation

◆ CreateForOption()

static IDividendYieldModel QuantConnect.Data.DividendYieldProvider.CreateForOption ( Symbol  optionSymbol)
static

Creates a new instance for the given option symbol

Definition at line 110 of file DividendYieldProvider.cs.

Here is the call graph for this function:

◆ GetDividendYield() [1/3]

decimal QuantConnect.Data.DividendYieldProvider.GetDividendYield ( DateTime  date)

Get dividend yield by a given date of a given symbol. It will get the dividend yield at the time of the most recent dividend since no price is provided. In order to get more accurate dividend yield, provide the security price at the given date to the GetDividendYield(DateTime, decimal) or GetDividendYield(IBaseData) methods.

Parameters
dateThe date
Returns
Dividend yield on the given date of the given symbol

Implements QuantConnect.Data.IDividendYieldModel.

Definition at line 152 of file DividendYieldProvider.cs.

Here is the caller graph for this function:

◆ GetDividendYield() [2/3]

decimal QuantConnect.Data.DividendYieldProvider.GetDividendYield ( IBaseData  priceData)

Gets the dividend yield at the date of the specified data, using the data price as the security price

Parameters
priceDataPrice data instance
Returns
Dividend yield on the given date of the given symbol

Price data must be raw (DataNormalizationMode.Raw)

Definition at line 163 of file DividendYieldProvider.cs.

Here is the call graph for this function:

◆ GetDividendYield() [3/3]

decimal QuantConnect.Data.DividendYieldProvider.GetDividendYield ( DateTime  date,
decimal  securityPrice 
)

Get dividend yield at given date and security price

Parameters
dateThe date
securityPriceThe security price at the given date
Returns
Dividend yield on the given date of the given symbol

Price data must be raw (DataNormalizationMode.Raw)

Implements QuantConnect.Data.IDividendYieldModel.

Definition at line 180 of file DividendYieldProvider.cs.

◆ LoadCorporateEvents()

virtual List<BaseData> QuantConnect.Data.DividendYieldProvider.LoadCorporateEvents ( Symbol  symbol)
protectedvirtual

Generate the corporate events from the corporate factor file for the specified symbol

Exposed for testing

Definition at line 278 of file DividendYieldProvider.cs.

Here is the call graph for this function:

Member Data Documentation

◆ _corporateEventsCache

Dictionary<Symbol, List<BaseData> > QuantConnect.Data.DividendYieldProvider._corporateEventsCache
staticprotected

The dividends by symbol

Definition at line 45 of file DividendYieldProvider.cs.

◆ _cacheClearTask

Task QuantConnect.Data.DividendYieldProvider._cacheClearTask
staticprotected

Task to clear the cache

Definition at line 50 of file DividendYieldProvider.cs.

◆ DefaultDividendYieldRate

readonly decimal QuantConnect.Data.DividendYieldProvider.DefaultDividendYieldRate = 0.0m
static

Default no dividend payout

Definition at line 59 of file DividendYieldProvider.cs.

Property Documentation

◆ DefaultSymbol

Symbol QuantConnect.Data.DividendYieldProvider.DefaultSymbol = Symbol.Create("SPY", SecurityType.Equity, QuantConnect.Market.USA)
staticgetset

The default symbol to use as a dividend yield provider

This is useful for index and future options which do not have an underlying that yields dividends. Defaults to SPY

Definition at line 40 of file DividendYieldProvider.cs.

◆ CacheRefreshPeriod

virtual TimeSpan QuantConnect.Data.DividendYieldProvider.CacheRefreshPeriod
getprotected

The cached refresh period for the dividend yield rate

Exposed for testing

Definition at line 66 of file DividendYieldProvider.cs.


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