-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code generated by Alternative-Datasets-Code-Generator.py
- Loading branch information
1 parent
68c9c0b
commit 4d5f889
Showing
81 changed files
with
580 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
9 changes: 9 additions & 0 deletions
9
... Algorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/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,9 @@ | ||
<p> | ||
The US Equity Option Chain Master dataset by QuantConnect lists the available US Equity Options contracts and the current Implied Volatility and Greeks. The data covers 4,000 Symbols, starts in January 2012, and is delivered on a daily update frequency. To create this dataset, we use <a href='https://www.quantconnect.com/research/16977/greeks-and-iv-implementation/p1'>our implementation</a> of the forward tree pricing model, which accounts for the interest rate, dividend payments, and daily closing prices. The values in this dataset are the same values you can get from daily <a href='/docs/v2/writing-algorithms/securities/asset-classes/equity-options/greeks-and-implied-volatility/indicators'>indicators</a> with mirror Options. | ||
</p> | ||
|
||
<p>This dataset depends on the <a href="/datasets/quantconnect-us-equity-security-master">US Equity Security Master</a> dataset because the US Equity Security Master dataset contains information on splits, dividends, and symbol changes of the underlying security.</p> | ||
|
||
<p>This dataset <b>does not</b> contain market data. For market data, see <a href="/datasets/algoseek-us-equity-options">US Equity Options by AlgoSeek</a>.</p> | ||
|
||
<p>For more information about the US Equity Option Universe dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-equity-option-universe">dataset listing</a>.<p> |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...gorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/03 Getting Started.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,10 @@ | ||
<p>The following snippet demonstrates how to request data from the US Equity Options dataset:</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="python">option = self.add_option("GOOG") | ||
self.option_symbol = option.symbol | ||
option.set_filter(lambda universe: universe.delta(0.4, 0.6))</pre> | ||
<pre><code class="csharp">var option = AddOption("GOOG"); | ||
_optionSymbol = option.Symbol; | ||
option.SetFilter(universe => universe.delta(0.4m, 0.6m));</code></pre> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
... Algorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/04 Data Summary.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,15 @@ | ||
<p>The following table describes the dataset properties:</p> | ||
|
||
<table class="table qc-table"><thead><tr><th>Property</th> | ||
<th>Value</th> | ||
</tr></thead><tbody><tr><td>Start Date</td> | ||
<td>January 2012</td> | ||
</tr><tr><td>Asset Coverage</td> | ||
<td>4,000 Symbols</td> | ||
</tr><tr><td>Data Density</td> | ||
<td>Dense</td> | ||
</tr><tr><td>Resolution</td> | ||
<td>Daily</td> | ||
</tr><tr><td>Timezone</td> | ||
<td>New York</td> | ||
</tr></tbody></table |
8 changes: 8 additions & 0 deletions
8
...hms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/05 Example Applications.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,8 @@ | ||
<p> | ||
The US Equity Options dataset enables you to accurately design Option strategies. Examples include the following strategies: | ||
</p> | ||
<ul><li>Buying put Options to hedge against downward price movement in positive Equity positions</li> | ||
<li>Exploiting arbitrage opportunities that arise when the price of Option contracts deviate from their theoretical value</li> | ||
</ul> | ||
<div class='python'><div class='qc-embed-frame' style='display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;'><div class='qc-embed-dummy' style='padding-top: 56.25%;'></div><div class='qc-embed-element' style='position: absolute; top: 0; bottom: 0; left: 0; right: 0;'><iframe class='qc-embed-backtest' src='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_467152d2f04391913b704e21767f1682.html' style='max-width: calc(100vw - 30px); max-height: 100vw; overflow: hidden;' scrolling='no' width='100%' height='100%'></iframe></div></div></div> | ||
<div class='csharp'><div class='qc-embed-frame' style='display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;'><div class='qc-embed-dummy' style='padding-top: 56.25%;'></div><div class='qc-embed-element' style='position: absolute; top: 0; bottom: 0; left: 0; right: 0;'><iframe class='qc-embed-backtest' src='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_ac6db075b8e9c9abc7c9d48c55db3871.html' style='max-width: calc(100vw - 30px); max-height: 100vw; overflow: hidden;' scrolling='no' width='100%' height='100%'></iframe></div></div></div><p>For more example algorithms, see <a href='/datasets/algoseek-us-equity-options/examples'>Examples</a>.</p> |
5 changes: 5 additions & 0 deletions
5
...ms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/06 Data Point Attributes.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,5 @@ | ||
<p>The US Equity Options dataset provides <b>OptionUniverse</b> object.</p> | ||
|
||
<h4>OptionUniverse Attributes</h4> | ||
<p><b>OptionUniverse</b> objects have the following attributes:</p> | ||
<div data-tree="QuantConnect.Data.UniverseSelection.OptionUniverse"></div> |
1 change: 1 addition & 0 deletions
1
...orithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/07 Supported Assets.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>To view the supported assets in the US Equity Options dataset, see the <a href="/datasets/algoseek-us-equity-options/explorer">Data Explorer</a>.</p> |
66 changes: 66 additions & 0 deletions
66
...gorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/08 Requesting Data.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,66 @@ | ||
<p>To add US Equity Options data to your algorithm, call the <b class="csharp">AddOption</b><b class="python">add_option</b> method. Save a reference to the Equity Option <b>Symbol</b> so you can access the data later in your algorithm.</p> | ||
|
||
<p>To set a contract filter, call the <b class="csharp">SetFilter</b><b class="python">set_filter</b> method of the Option object.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre><code class="python">class USEquityOptionsDataAlgorithm(QCAlgorithm): | ||
|
||
def initialize(self) -> None: | ||
self.set_start_date(2020, 6, 1) | ||
self.set_end_date(2021, 6, 1) | ||
self.set_cash(100000) | ||
self.universe_settings.asynchronous = True | ||
option = self.add_option("GOOG") | ||
self.option_symbol = option.symbol | ||
# Set our strike/expiry filter for this option chain | ||
option.set_filter(self._option_filter) | ||
|
||
def _option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse: | ||
# Contracts can be filtered by greeks, implied volatility, open interest: | ||
return universe \ | ||
.delta(0.5, 1.5) \ | ||
.gamma(0.0001, 0.0006) \ | ||
.vega(0.01, 1.5) \ | ||
.theta(-2.0, -0.5) \ | ||
.rho(0.5, 3.0) \ | ||
.implied_volatility(1, 3) \ | ||
.open_interest(100,500) | ||
</code></pre> | ||
<pre class="csharp">namespace QuantConnect | ||
{ | ||
public class USEquityOptionsDataAlgorithm : QCAlgorithm | ||
{ | ||
private Symbol _optionSymbol; | ||
|
||
public override void Initialize() | ||
{ | ||
SetStartDate(2020, 6, 1); | ||
SetEndDate(2021, 6, 1); | ||
SetCash(100000); | ||
UniverseSettings.Asynchronous = True; | ||
// Requesting data | ||
var option = AddOption("GOOG"); | ||
_optionSymbol = option.Symbol; | ||
// Set our strike/expiry filter for this option chain | ||
option.SetFilter(OptionFilter); | ||
} | ||
|
||
private virtual OptionFilterUniverse OptionFilter(OptionFilterUniverse universe) | ||
{ | ||
// Contracts can be filtered by greeks, implied volatility, open interest: | ||
return universe | ||
.Delta(0.5m, 1.5m) | ||
.Gamma(0.0001m, 0.0006m) | ||
.Vega(0.01m, 1.5m) | ||
.Theta(-2.0m, -0.5m) | ||
.Rho(0.5m, 3.0m) | ||
.ImpliedVolatility(1.0m, 3.0m) | ||
.OpenInterest(100m, 500m); | ||
} | ||
} | ||
}</pre> | ||
</div> | ||
|
||
<p>The Equity resolution must be less than or equal to the Equity Option resolution. For example, if you set the Equity resolution to minute, then you must set the Equity Option resolution to minute, hour, or daily.</p> | ||
|
||
<p>For more information about creating US Equity Option subscriptions, see <a href="/docs/v2/writing-algorithms/securities/asset-classes/equity-options/requesting-data">Requesting Data</a>.</p> |
1 change: 1 addition & 0 deletions
1
...lgorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/09 Accessing Data.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>For information about accessing US Equity Options data, see <a href="/docs/v2/writing-algorithms/securities/asset-classes/equity-options/handling-data">Handling Data</a>.</p> |
44 changes: 44 additions & 0 deletions
44
...gorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/10 Historical Data.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,44 @@ | ||
<p>You can get historical US Index Options data in an algorithm and the Research Environment.</p> | ||
|
||
<h4>Historical Data In Algorithms</h4> | ||
|
||
<p>To get historical US Index Options data in an algorithm, call the <b class="csharp">History</b><b class="python">history</b> method with the Index Option chain <b>Symbol</b>. If there is no data in the period you request, the history result is empty.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="python"># DataFrame | ||
history_df = self.history(self.option_symbol, 3, Resolution.MINUTE)</pre> | ||
|
||
<pre><code class="csharp">// TradeBar objects | ||
var history = History<OptionUniverse>(option, 3, Resolution.Daily).ToList();</code></pre> | ||
</div> | ||
|
||
<p>For more information about historical data in algorithms, see <a href="/docs/v2/writing-algorithms/historical-data/history-requests">History Requests</a>.</p> | ||
|
||
<h4>Historical Data In Research</h4> | ||
|
||
<p>To get historical US Index Options data in the Research Environment for an entire Option chain, call the <b class="csharp">OptionHistory</b><b class="python">option_history</b> method with the canonical Option <b>Symbol</b>.</p> | ||
|
||
<div class="section-example-container"> | ||
<pre class="python">qb = QuantBook() | ||
index_symbol = qb.add_index('VIX').symbol | ||
option = qb.add_index_option(index_symbol) # or qb.add_index_option(index_symbol, "VIXW") | ||
option.set_filter(-2, 2, 0, 90) | ||
history = qb.option_history(option.symbol, datetime(2020, 6, 1), datetime(2020, 6, 5)) | ||
|
||
all_history = history.get_all_data() | ||
expiries = history.get_expiry_dates() | ||
strikes = history.get_strikes()</pre> | ||
|
||
|
||
<pre class="csharp">var qb = new QuantBook(); | ||
var indexSymbol = qb.AddIndex("VIX").Symbol; | ||
var option = qb.AddIndexOption(indexSymbol); // or qb.AddIndexOption(indexSymbol, "VIXW"); | ||
option.SetFilter(-2, 2, 0, 90); | ||
var history = qb.OptionHistory(option.Symbol, new DateTime(2020, 6, 1), new DateTime(2020, 6, 5)); | ||
|
||
var contracts = history.SelectMany(x => x.OptionChains.SelectMany(y => y.Value.Contracts.Keys)).Distinct().ToList(); | ||
var expiries = contracts.Select(x => x.ID.Date).Distinct().ToList(); | ||
var strikes = contracts.Select(x => x.ID.StrikePrice).Distinct().ToList();</pre> | ||
</div> | ||
|
||
<p>To get historical data for a single US Index Option contract, call the <b class="csharp">History</b><b class="python">history</b> method like you would in an algorithm but on the <b>QuantBook</b> object. For more information about historical data in the Research Environment, see <a href="/docs/v2/research-environment/datasets/index-options">Index Options</a>.</p> |
8 changes: 8 additions & 0 deletions
8
...hms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/99 Example Applications.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,8 @@ | ||
<p> | ||
The US Equity Options dataset enables you to accurately design Option strategies. Examples include the following strategies: | ||
</p> | ||
<ul><li>Buying put Options to hedge against downward price movement in positive Equity positions</li> | ||
<li>Exploiting arbitrage opportunities that arise when the price of Option contracts deviate from their theoretical value</li> | ||
</ul> | ||
<div class='python'><div class='qc-embed-frame' style='display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;'><div class='qc-embed-dummy' style='padding-top: 56.25%;'></div><div class='qc-embed-element' style='position: absolute; top: 0; bottom: 0; left: 0; right: 0;'><iframe class='qc-embed-backtest' src='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_467152d2f04391913b704e21767f1682.html' style='max-width: calc(100vw - 30px); max-height: 100vw; overflow: hidden;' scrolling='no' width='100%' height='100%'></iframe></div></div></div> | ||
<div class='csharp'><div class='qc-embed-frame' style='display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;'><div class='qc-embed-dummy' style='padding-top: 56.25%;'></div><div class='qc-embed-element' style='position: absolute; top: 0; bottom: 0; left: 0; right: 0;'><iframe class='qc-embed-backtest' src='https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_ac6db075b8e9c9abc7c9d48c55db3871.html' style='max-width: calc(100vw - 30px); max-height: 100vw; overflow: hidden;' scrolling='no' width='100%' height='100%'></iframe></div></div></div><p>For more example algorithms, see <a href='/datasets/algoseek-us-equity-options/examples'>Examples</a>.</p> |
12 changes: 12 additions & 0 deletions
12
03 Writing Algorithms/14 Datasets/02 QuantConnect/06 US Equity Option Universe/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": "US Equity Option Universe dataset from QuantConnect.", | ||
"keywords": "data, financial data, alternative dataset", | ||
"og:description": "US Equity Option Universe dataset from QuantConnect.", | ||
"og:title": "US Equity Option Universe - Documentation QuantConnect.com", | ||
"og:type": "website", | ||
"og:site_name": "US Equity Option Universe - QuantConnect.com", | ||
"og:image": "https://cdn.quantconnect.com/docs/i/writing-algorithms/datasets/quantconnect/us-equity-option-universe.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.
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
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
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
4 changes: 4 additions & 0 deletions
4
...er/11 Accessing Symbol Change Events.html → ...er/11 Accessing Symbol Change Events.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
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
03 Writing Algorithms/14 Datasets/02 QuantConnect/07 US Equity Security Master/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": "US Equity Security Master dataset from QuantConnect.", | ||
"keywords": "data, financial data, alternative dataset", | ||
"og:description": "US Equity Security Master dataset from QuantConnect.", | ||
"og:title": "US Equity Security Master - Documentation QuantConnect.com", | ||
"og:type": "website", | ||
"og:site_name": "US Equity Security Master - QuantConnect.com", | ||
"og:image": "https://cdn.quantconnect.com/docs/i/writing-algorithms/datasets/quantconnect/us-equity-security-master.png" | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...thms/14 Datasets/02 QuantConnect/07 US Futures Security Master/10 Data Mapping Modes.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.