Skip to content

Commit

Permalink
Generates Datasets Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCatarino committed Nov 30, 2024
1 parent fb27164 commit 89f588d
Show file tree
Hide file tree
Showing 474 changed files with 108 additions and 216 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>The Binance Crypto Future Margin Rate Data by QuantConnect is for crypto-currency futures margin interest data points. The data covers 421 Cryptocurrency pairs, starts in August 2020, and is delivered on a daily update frequency. This dataset is created by downloading data using Binance API.</p>

<p>This dataset is an important companion to the <a href="/datasets/binance-cryptofuture-price-data">Binance Crypto Future Price Data</a> dataset because it contains information on margin interest data to model margin costs.</p>

<p>For more information about the Binance Crypto Future Margin Rate Data dataset, including CLI commands and pricing, see the <a href="/datasets/binance-cryptofuture-margin-rate-data">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>The Bybit Crypto Future Margin Rate Data by QuantConnect is for Cryptocurrency Futures margin interest data points. The data covers 433 Cryptocurrency pairs, starts in August 2020, and is delivered on a daily update frequency. This dataset is created by downloading data using Bybit API.</p>

<p>This dataset is an important companion to the <a href="/datasets/bybit-cryptofuture-price-data">Bybit Crypto Future Price Data</a> dataset because it contains information on margin interest data to model margin costs.</p>

<p>For more information about the Bybit Crypto Future Margin Rate Data dataset, including CLI commands and pricing, see the <a href="/datasets/bybit-cryptofuture-margin-rate-data">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<p>To add Bybit Crypto Future Margin Rate data to your algorithm, call the <b class="csharp">AddCryptoFuture</b><b class="python">add_crypto_future</b> method. Save a reference to the Crypto Future <b>Symbol</b> so you can access the data later in your algorithm.</p>

<div class="section-example-container">
<pre><code class="python">from AlgorithmImports import *
<pre class="python">from AlgorithmImports import *
from QuantConnect.DataSource import *

class CoinAPIDataAlgorithm(QCAlgorithm):

def initialize(self) -> None:
def initialize(self) -&gt; None:
self.set_start_date(2020, 6, 1)
self.set_end_date(2021, 6, 1)

Expand All @@ -17,7 +17,7 @@

crypto_future = self.add_crypto_future("BTCUSDT", Resolution.MINUTE)
# perpetual futures does not have a filter function
self.btcusdt = crypto_future.symbol</code></pre>
self.btcusdt = crypto_future.symbol</pre>
<pre class="csharp">namespace QuantConnect
{
public class CoinAPIDataAlgorithm : QCAlgorithm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p>To get the current Bybit Crypto Margin Rate data, index the <b class="csharp">MarginInterestRates</b><b class="python">margin_interest_rates</b> property of the current <a href="/docs/v2/writing-algorithms/key-concepts/time-modeling/timeslices"><b>Slice</b></a> with the Crypto Future <b>Symbol</b>. <b>Slice</b> objects deliver unique events to your algorithm as they happen, but the <b>Slice</b> may not contain data for your security at every time step. To avoid issues, check if the <b>Slice</b> contains the data you want before you index it.</p>

<div class="section-example-container">
<pre><code class="python">def on_data(self, slice: Slice) -> None:
<pre class="python">def on_data(self, slice: Slice) -&gt; None:
if self.btcusdt in slice.margin_interest_rates:
interest_rate = slice.margin_interest_rates[self.btcusdt].interest_rate
self.log(f"{self.btcusdt} close at {slice.time}: {interest_rate}")</code></pre>
self.log(f"{self.btcusdt} close at {slice.time}: {interest_rate}")</pre>
<pre class="csharp">public override void OnData(Slice slice)
{
if (slice.MarginInterestRates.ContainsKey(_symbol))
Expand All @@ -18,10 +18,10 @@
<p>You can also iterate through all of the data objects in the current <b>Slice</b>.</p>

<div class="section-example-container">
<pre><code class="python">def on_data(self, slice: Slice) -> None:
<pre class="python">def on_data(self, slice: Slice) -&gt; None:
for symbol, margin_interest_rate in slice.margin_interest_rates.items():
interest_rate = margin_interest_rate.interest_rate
self.log(f"{symbol} close at {slice.time}: {interest_rate}")</code></pre>
self.log(f"{symbol} close at {slice.time}: {interest_rate}")</pre>
<pre class="csharp">public override void OnData(Slice slice)
{
foreach (var kvp in slice.MarginInterestRates)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>The CFD Data by QuantConnect serves 51 <a href="https://www.investopedia.com/terms/c/contractfordifferences.asp">contracts for differences</a> (CFD). The data starts as early as May 2002 and is delivered on any frequency from tick to daily. This dataset is created by QuantConnect processing raw tick data from OANDA.</p>

<p>For more information about the CFD Data dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-cfd">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>The FOREX Data by QuantConnect serves 71 <a href="https://www.investopedia.com/terms/f/forex.asp">foreign exchange</a> (FOREX) pairs, starts on various dates from January 2007, and is delivered on any frequency from tick to daily. This dataset is created by QuantConnect processing raw tick data from OANDA.</p>

<p>For more information about the FOREX Data dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-forex">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
</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.</p>

<p>For more information about the US ETF Constituents dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-etf-constituents">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ <h4>Historical Universe Data in Research</h4>
print(f"{constituent.symbol} weight at {constituent.end_time}: {constituent.weight}")</pre>
</div>

<p>You can call the <b class="csharp">History</b><b class="python">history</b> method in Research.</p>
<p>You can call the <b class="csharp">History</b><b class="python">history</b> method in Research.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
</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.</p>

<p>For more information about the US Equities Short Availability dataset, including CLI commands and pricing, see the <a href="/datasets/us-equities-short-availability">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<p>This dataset depends on the <a href="/datasets/algoseek-us-equities">US Equities by AlgoSeek</a> dataset because <a href="/docs/v2/writing-algorithms/universes/key-concepts#02-How-Universe-Selection-Works">universe selection</a> adds and removes market data subscriptions and 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.</p>

<p>QuantConnect/LEAN combines the data of this dataset with <a href="/datasets/morning-star-us-fundamentals">MorningStar Fundamental data</a> in runtime. You can use this dataset in local development without the Morningstar counterpart.</p>

<p>For more information about the US Equity Coarse Universe dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-coarse-universe-constituents">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def fundamental_filter_function(self, fundamental: List[Fundamental]):
# Sort all equities with price above $10 by dollar volume
sorted_by_dollar_volume = sorted([f for f in fundamental if f.price &gt; 10],
key=lambda f: f.dollar_volume)
key=lambda f: f.dollar_volume, reverse=True)
# Take the top 10
return [f.symbol for f in sorted_by_dollar_volume[:10]]</pre>
<pre class="csharp">public override void Initialize()
Expand All @@ -36,7 +36,7 @@
// Sort all equities with price above $10 by dollar volume, take the top 10
return (from f in fundamental
where f.Price &gt; 10
orderby f.DollarVolume
orderby f.DollarVolume descending
select f.Symbol).Take(10);
}</pre>
</div>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>The US Equity Coarse Universe dataset provides its data within <b>Fundamental</b> objects, which have the following attributes:</p>
<p>The US Equity Coarse Universe dataset provides its data within <b>Fundamental</b> objects, which have the following . The attributes from <b class='python'>market_cap</b><b class='csharp'>MarketCap</b> to <b class='python'>asset_classification</b><b class='csharp'>AssetClassification</b> listed in the following widget are NaN until this dataset is combined with the <a href='/datasets/morning-star-us-fundamentals'>MorningStar Fundamental</a> dataset.</p>
<div data-tree="QuantConnect.Data.Fundamental.Fundamental"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ <h4>Historical Universe Data in Research</h4>
print(f"{fundamental.symbol} dollar volume at {fundamental.end_time}: {fundamental.dollar_volume}")</pre>
</div>

<p>For more information about historical US Equity fundamental data, see <a href="/docs/v2/research-environment/datasets/equity-fundamental-data">Equity Fundamental Data</a>.</p>
<p>For more information about historical US Equity fundamental data, see <a href="/docs/v2/research-environment/datasets/equity-fundamental-data">Equity Fundamental Data</a>.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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");
<pre class="csharp">var option = AddOption("GOOG");
_optionSymbol = option.Symbol;
option.SetFilter(universe => universe.delta(0.4m, 0.6m));</code></pre>
option.SetFilter(universe =&gt; universe.delta(0.4m, 0.6m));</pre>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<td>Daily</td>
</tr><tr><td>Timezone</td>
<td>New York</td>
</tr></tbody></table
</tr></tbody></table>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>The <b class="csharp">AddOption</b><b class="python">add_option</b> method provides a daily stream of Option chain data. To get the most recent daily chain, call the <b class="csharp">OptionChain</b><b class="python">option_chain</b> method with the underlying Equity Symbol. The <b class="csharp">OptionChain</b><b class="python">option_chain</b> method returns data on all the tradable contracts, not just the contracts that pass your universe filter.</p>

<div class="section-example-container">
<pre><code class="python">class USEquityOptionsDataAlgorithm(QCAlgorithm):
<pre class="python">class USEquityOptionsDataAlgorithm(QCAlgorithm):

def initialize(self) -&gt; None:
self.set_start_date(2020, 6, 1)
Expand All @@ -17,7 +17,7 @@
# Get the entire Option chain for the current day.
chain = self.option_chain(option.symbol.underlying, flatten=True).data_frame

def _option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:
def _option_filter(self, universe: OptionFilterUniverse) -&gt; OptionFilterUniverse:
# Contracts can be filtered by greeks, implied volatility, open interest:
return universe \
.delta(0.5, 1.5) \
Expand All @@ -27,7 +27,7 @@
.rho(0.5, 3.0) \
.implied_volatility(1, 3) \
.open_interest(100,500)
</code></pre>
</pre>
<pre class="csharp">namespace QuantConnect
{
public class USEquityOptionsDataAlgorithm : QCAlgorithm
Expand Down Expand Up @@ -67,4 +67,4 @@

<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 Universes, see <a href="/docs/v2/writing-algorithms/universes/equity-options">Equity Options</a>.</p>
<p>For more information about creating US Equity Option Universes, see <a href="/docs/v2/writing-algorithms/universes/equity-options">Equity Options</a>.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ <h4>Historical Data In Research</h4>
{
var endTime = chain.EndTime;
var filteredContracts = chain.Data
.Select(contract => contract as OptionUniverse)
.Where(contract => contract.Greeks.Delta > 0.3m);
.Select(contract =&gt; contract as OptionUniverse)
.Where(contract =&gt; contract.Greeks.Delta > 0.3m);
foreach (var contract in filteredContracts)
{
var price = contract.Price;
Expand All @@ -43,4 +43,4 @@ <h4>Historical Data In Research</h4>
}</code></pre>
</div>

<p>For more information about historical Equity Options Universe data in the Research Environment, see <a href="/docs/v2/research-environment/datasets/equity-options/universes">Universes</a>.</p>
<p>For more information about historical Equity Options Universe data in the Research Environment, see <a href="/docs/v2/research-environment/datasets/equity-options/universes">Universes</a>.</p>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>
The US Equity Security Master dataset by QuantConnect tracks US Equity corporate actions, including splits, dividends, delistings, mergers, and ticker changes through history. The data covers approximately 27,500 US Equities, starts in January 1998, and is delivered on a daily update frequency. You can easily download and install the dataset with the LEAN CLI so it's ready to use by LEAN. LEAN automatically handles all corporate actions and passes them into your algorithm as <a href="/docs/v2/writing-algorithms/securities/asset-classes/us-equity/corporate-actions">events</a>.
</p>

<p>For more information about the US Equity Security Master dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-equity-security-master">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<p>VIX Futures don't support continous contract rolling with open interest.</p>

<p>This is <em>not</em> the underlying Futures data (<a href='/datasets/algoseek-us-futures'>US Futures</a> dataset), which you need to purchase separately with a license from AlgoSeek. This security master dataset is required to purchase the US Futures or US Future Options datasets.</p>

<p>For more information about the US Futures Security Master dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-futures-security-master">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
</p>

<p>This dataset <b>does not</b> contain market data. For market data, see <a href="/datasets/algoseek-us-index-options">US Index Options by AlgoSeek</a>.</p>

<p>For more information about the US Index Option Universe dataset, including CLI commands and pricing, see the <a href="/datasets/quantconnect-us-index-option-universe">dataset listing</a>.<p>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<pre class="python">option = self.add_index_option('VIX')
option.set_filter(lambda universe: universe.delta(0.4, 0.6))
self.option_symbol = option.symbol</pre>
<pre><code class="csharp">var option = AddIndexOption("VIX");
option.SetFilter(universe => universe.delta(0.4m, 0.6m));
_optionSymbol = option.Symbol;</code></pre>
<pre class="csharp">var option = AddIndexOption("VIX");
option.SetFilter(universe =&gt; universe.delta(0.4m, 0.6m));
_optionSymbol = option.Symbol;</pre>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<td>Daily</td>
</tr><tr><td>Timezone</td>
<td>New York</td>
</tr></tbody></table
</tr></tbody></table>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>The <b class="csharp">AddIndexOption</b><b class="python">add_index_option</b> method provides a daily stream of Option chain data. To get the most recent daily chain, call the <b class="csharp">OptionChain</b><b class="python">option_chain</b> method with the canonical Index Option Symbol. The <b class="csharp">OptionChain</b><b class="python">option_chain</b> method returns data on all the tradable contracts, not just the contracts that pass your universe filter.</p>

<div class="section-example-container">
<pre><code class="python">class IndexOptionsDataAlgorithm(QCAlgorithm):
<pre class="python">class IndexOptionsDataAlgorithm(QCAlgorithm):

def initialize(self) -&gt; None:
self.set_start_date(2021, 1, 1)
Expand All @@ -26,7 +26,7 @@
]


def _option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:
def _option_filter(self, universe: OptionFilterUniverse) -&gt; OptionFilterUniverse:
# Contracts can be filtered by greeks, implied volatility, open interest:
return universe \
.delta(0.5, 1.5) \
Expand All @@ -35,8 +35,8 @@
.theta(-2.0, -0.5) \
.rho(0.5, 3.0) \
.implied_volatility(1, 3) \
.open_interest(100,500)</code></pre>
<pre><code class="csharp">namespace QuantConnect
.open_interest(100,500)</pre>
<pre class="csharp">namespace QuantConnect
{
public class IndexOptionsDataAlgorithm : QCAlgorithm
{
Expand All @@ -59,7 +59,7 @@
weeklyOption.SetFilter(OptionFilter);
_weeklyOptionSymbol = weeklyOption.Symbol;
var weeklyChain = OptionChain(_weeklyOptionSymbol)
.Where(contract => !IndexOptionSymbol.IsStandard(contract.Symbol));
.Where(contract =&gt; !IndexOptionSymbol.IsStandard(contract.Symbol));
}

private virtual OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)
Expand All @@ -75,9 +75,9 @@
.OpenInterest(100, 500);
}
}
}</code></pre>
}</pre>
</div>

<p>The Index resolution must be less than or equal to the Index Option resolution. For example, if you set the Index resolution to minute, then you must set the Index Option resolution to minute, hour, or daily.</p>

<p>For more information about creating US Index Option subscriptions, see <a href="/docs/v2/writing-algorithms/universes/index-options">Index Options</a>.</p>
<p>For more information about creating US Index Option subscriptions, see <a href="/docs/v2/writing-algorithms/universes/index-options">Index Options</a>.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ <h4>Historical Data In Research</h4>
{
var endTime = chain.EndTime;
var filteredContracts = chain.Data
.Select(contract => contract as OptionUniverse)
.Where(contract => contract.Greeks.Delta > 0.3m);
.Select(contract =&gt; contract as OptionUniverse)
.Where(contract =&gt; contract.Greeks.Delta > 0.3m);
foreach (var contract in filteredContracts)
{
var price = contract.Price;
Expand Down
Loading

0 comments on commit 89f588d

Please sign in to comment.