-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7677a8
commit 9cd1534
Showing
39 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...ing Algorithms/24 Reality Modeling/10 Dividend Yield/01 Key Concepts/01 Introduction.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>The dividend yield refers to the rate of return an investor earns from holding a stock in the form of dividends. Dividends are periodic payments made by a company to its shareholders out of its earnings.</p> | ||
|
||
<p>In the context of option pricing models, the dividend yield is a critical factor because it affects the value of the underlying stock. When calculating the theoretical price of an option using these models, the dividend yield is factored into the equation.</p> |
12 changes: 12 additions & 0 deletions
12
...iting Algorithms/24 Reality Modeling/10 Dividend Yield/01 Key Concepts/02 Set Models.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<p>To set the dividend yield model for an option indicator, use the <code>dividendYieldModel</code> parameter.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="csharp">// Before creating the indicator, create the set dividend yield model | ||
var dividendYieldModel = new DividendYieldProvider(symbol.Underlying); | ||
_iv = new ImpliedVolatility(symbol, RiskFreeInterestRateModel, dividendYieldModel, OptionPricingModelType.BlackScholes);</pre> | ||
<pre class="python"># Before creating the indicator, create the set dividend yield model | ||
dividendYieldModel = DividendYieldProvider(symbol.Underlying) | ||
self.iv = ImpliedVolatility(symbol, self.RiskFreeInterestRateModel, dividendYieldModel, OptionPricingModelType.BlackScholes)</pre> | ||
</div> | ||
|
||
<p>To view all the pre-built dividend yield models, see <a href='/docs/v2/writing-algorithms/reality-modeling/dividend-yield/supported-models'>Supported Models</a>.</p> |
2 changes: 2 additions & 0 deletions
2
...Algorithms/24 Reality Modeling/10 Dividend Yield/01 Key Concepts/03 Default Behavior.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<p>For US Equity Options, the default dividend yield model is the <a href='/docs/v2/writing-algorithms/reality-modeling/dividend-yield/supported-models#04-Dividend-Yield-Provider-Model'>DividendYieldProvider</a>, which provides the yield of the last payment.</pp> | ||
<p>For other option types, the default dividend yield model is the <a href='/docs/v2/writing-algorithms/reality-modeling/dividend-yield/supported-models#02-Constant-Model'>ConstantDividendYieldModel</a> with zero yield.</p> |
26 changes: 26 additions & 0 deletions
26
... Algorithms/24 Reality Modeling/10 Dividend Yield/01 Key Concepts/04 Model Structure.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<p>Dividend yield models must extend the <code>IDividendYieldModel</code> interface. Extensions of the <code>IDividendYieldModel</code> interface must implement a <code>GetDividendYield</code> method. The <code>GetDividendYield</code> method returns the dividend yield for a given date.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="csharp">// Before creating the indicator, create the set dividend yield model | ||
var dividendYieldModel = new MyDividendYieldModel(); | ||
_iv = new ImpliedVolatility(symbol, RiskFreeInterestRateModel, dividendYieldModel, OptionPricingModelType.BlackScholes); | ||
|
||
// Define the custom dividend yield model | ||
public class MyDividendYieldModel : IDividendYieldModel | ||
{ | ||
public decimal GetDividendYield(DateTime date) | ||
{ | ||
return 0.02m; | ||
} | ||
}</pre> | ||
<pre class="python"># Before creating the indicator, create the set dividend yield model | ||
dividendYieldModel = MyDividendYieldModel() | ||
self.iv = ImpliedVolatility(symbol, self.RiskFreeInterestRateModel, dividendYieldModel, OptionPricingModelType.BlackScholes) | ||
|
||
# Define the custom dividend yield model | ||
class MyDividendYieldModel: | ||
def GetDividendYield(self, date: datetime) -> float: | ||
return 0.02</pre> | ||
</div> | ||
|
||
<p>For a full example algorithm, see <span class='python'><a href='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_20d0faedc86be00cb5f7e2e2cc4f9b79.html'>this backtest</a></span><span class='csharp'><a href='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_157d3106f24568d8aa43d169f2ccf52a.html'>this backtest</a></span>.</p> |
12 changes: 12 additions & 0 deletions
12
03 Writing Algorithms/24 Reality Modeling/10 Dividend Yield/01 Key Concepts/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "metadata", | ||
"values": { | ||
"description": "The dividend yield refers to the rate of return an investor earns from holding a stock in the form of dividends.", | ||
"keywords": "dividend yield, option modeling, option indicators", | ||
"og:description": "The dividend yield refers to the rate of return an investor earns from holding a stock in the form of dividends.", | ||
"og:title": "Key Concepts - Documentation QuantConnect.com", | ||
"og:type": "website", | ||
"og:site_name": "Key Concepts - QuantConnect.com", | ||
"og:image": "https://cdn.quantconnect.com/docs/i/writing-algorithms/reality-modeling/dividend-yield/key-concepts.png" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...Algorithms/24 Reality Modeling/10 Dividend Yield/02 Supported Models/01 Introduction.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>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 <a href='/docs/v2/writing-algorithms/reality-modeling/dividend-yield/key-concepts#04-Model-Structure'>custom dividend yield model</a>.</p> |
27 changes: 27 additions & 0 deletions
27
...gorithms/24 Reality Modeling/10 Dividend Yield/02 Supported Models/02 Constant Model.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<p>The <code>ConstantDividendYieldModel</code> returns a constant yield across time. It's the default dividend yield rate model for securities that don't pay dividends.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="csharp">_dividendYieldModel = new ConstantDividendYieldModel(0.02m);</pre> | ||
<pre class="python">self.dividendYieldModel = ConstantDividendYieldModel(0.02);</pre> | ||
</div> | ||
|
||
<p>The following table describes the arguments the model accepts:</p> | ||
|
||
<table class="qc-table table"> | ||
<thead> | ||
<tr> | ||
<th>Argument</th> | ||
<th>Data Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><code>dividendYield</code></td> | ||
<td><code class="csharp">decimal</code><code class="python">float</code></td> | ||
<td>The dividend yield</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<p>To view the implementation of this model, see the <a target="_blank" rel="nofollow" href="https://github.com/QuantConnect/Lean/blob/master/Common/Data/ConstantDividendYieldModel.cs">LEAN GitHub repository</a>.</p> |
29 changes: 29 additions & 0 deletions
29
...lity Modeling/10 Dividend Yield/02 Supported Models/04 Dividend Yield Provider Model.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<p>The <code>DividendYieldProvider</code> estimated annualized continuous dividend yield at given date from historical dividend payments.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="csharp">var symbol = AddEquity("MSFT").Symbol; | ||
_dividendYieldModel = new DividendYieldProvider(symbol);</pre> | ||
<pre class="python">symbol = self.AddEquity("MSFT").Symbol | ||
self.dividendYieldModel = DividendYieldProvider(symbol);</pre> | ||
</div> | ||
|
||
<p>The following table describes the arguments the model accepts:</p> | ||
|
||
<table class="qc-table table"> | ||
<thead> | ||
<tr> | ||
<th>Argument</th> | ||
<th>Data Type</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><code>symbol</code></td> | ||
<td><code>Symbol</code></td> | ||
<td>The symbol of a dividend-paying security</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<p>To view the implementation of this model, see the <a target="_blank" rel="nofollow" href="https://github.com/QuantConnect/Lean/blob/master/Common/Data/DividendYieldProvider.cs">LEAN GitHub repository</a>.</p> |
12 changes: 12 additions & 0 deletions
12
...riting Algorithms/24 Reality Modeling/10 Dividend Yield/02 Supported Models/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "metadata", | ||
"values": { | ||
"description": "This page describes all of the pre-built dividend yield models in LEAN", | ||
"keywords": "constant dividend yield, historical dividend yield,", | ||
"og:description": "This page describes all of the pre-built dividend yield models in LEAN", | ||
"og:title": "Supported Models - Documentation QuantConnect.com", | ||
"og:type": "website", | ||
"og:site_name": "Supported Models - QuantConnect.com", | ||
"og:image": "https://cdn.quantconnect.com/docs/i/writing-algorithms/reality-modeling/dividend-yield/supported-models.png" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.