Skip to content

Commit

Permalink
Move New Fundamental from Draft to Final
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCatarino committed Oct 27, 2023
1 parent d593eb3 commit 77decf4
Show file tree
Hide file tree
Showing 108 changed files with 314 additions and 1,653 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<p>The US Equities data feed enables you to create a dynamic universe of securities.</p>

<h4>Coarse-Fine Universe</h4>
<?php echo file_get_contents(DOCS_RESOURCES."/data-feeds/us-equities/coarse-fine-data-availability.html"); ?>
<h4>Fundamental Universe</h4>
<? include(DOCS_RESOURCES."/data-feeds/us-equities/fundamental-data-availability.html"); ?>
<div class="section-example-container">
<pre class="csharp">AddUniverse(SelectCoarse, SelectFine);</pre>
<pre class="python">self.AddUniverse(self.SelectCoarse, self.SelectFine)</pre>
<pre class="csharp">AddUniverse(SelectFundamental);</pre>
<pre class="python">self.AddUniverse(self.SelectFundamental)</pre>
</div>

<h4>ETF Constituent Universe</h4>
<p>The US Equities data feed enables you to create a universe of securities to match the constituents of an ETF. For more information about ETF universes, see <a href='/docs/v2/writing-algorithms/universes/equity#04-ETF-Constituents-Selection'>ETF Constituents Selection </a>.</p>
<p>The US Equities data feed enables you to create a universe of securities to match the constituents of an ETF. For more information about ETF universes, see <a href='/docs/v2/writing-algorithms/universes/equity/etf-constituents-universes'>ETF Constituents Selection</a>.</p>

<div class="section-example-container">
<pre class="csharp">var spy = AddEquity("SPY").Symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
<?
$availability=true;
$dataFeedName= "IB";
include(DOCS_RESOURCES."/data-feeds/universe-selection.php");
$getUniverseSelectionText("IB", true);
?>

<p>The universe selection data comes from our Dataset Market, not the <a rel='nofollow' target='_blank' href='https://interactivebrokers.github.io/tws-api/market_scanners.html'>TWS market scanners</a>. Universe selection with the IB data feed occurs around 6-7 AM Eastern Time (ET) on Tuesday to Friday and at 2 AM ET on Sunday. Universe selection data isn't available when the IB servers are closed. To check the IB server status, see the <a rel='nofollow' target='_blank' href='https://www.interactivebrokers.com/en/software/systemStatus.php'>Current System Status</a> page on the IB website.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
<?
$availability=true;
$dataFeedName= "Tradier";
include(DOCS_RESOURCES."/data-feeds/universe-selection.php");
$getUniverseSelectionText("Tradier", true);
?>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<pre class="csharp">var hasFundamentalData = Securities[_symbol].Fundamentals.HasFundamentalData;</pre>
<pre class="python">has_fundamental_data = self.Securities[self.symbol].Fundamentals.HasFundamentalData</pre>
</div>
<p>For more information about fundamental data, see <a href='/docs/v2/drafts/writing-algorithms/securities/asset-classes/us-equity/corporate-fundamentals'>Corporate Fundamentals</a>.</p>
<p>For more information about fundamental data, see <a href='/docs/v2/writing-algorithms/securities/asset-classes/us-equity/corporate-fundamentals'>Corporate Fundamentals</a>.</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>Corporate fundamental data contains all the information on the underlying company of an Equity asset and the information in their financial statements. Since corporate data contains information not found in price and alternative data, adding corporate data to your trading strategies provides you with more information so you can make more informed trading decisions. Corporate fundamental data is available through the <a href="https://www.quantconnect.com/datasets/morning-star-us-fundamentals">US Fundamental Data from Morningstar</a>. To get fundamental data into your algorithm, add a <a href="/docs/v2/writing-algorithms/universes/equity#05-Fundamentals-Selection">fundamental universe</a>.</p>
<p>Corporate fundamental data contains all the information on the underlying company of an Equity asset and the information in their financial statements. Since corporate data contains information not found in price and alternative data, adding corporate data to your trading strategies provides you with more information so you can make more informed trading decisions. Corporate fundamental data is available through the <a href="https://www.quantconnect.com/datasets/morning-star-us-fundamentals">US Fundamental Data from Morningstar</a>.</p>

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<p>The following example filter function selects the 100 most liquid US Equities.</p>

<div class="section-example-container">
<pre class="csharp">public class MyCoarseUniverseAlgorithm : QCAlgorithm
<pre class="csharp">public class MyFundamentalUniverseAlgorithm : QCAlgorithm
{
public override void Initialize()
{
AddUniverse(CoarseFilterFunction);
AddUniverse(FundamentalFilterFunction);
}

private IEnumerable&lt;Symbol&gt; CoarseFilterFunction(IEnumerable&lt;CoarseFundamental&gt; coarse)
private IEnumerable&lt;Symbol&gt; FundamentalFilterFunction(IEnumerable&lt;Fundamental&gt; fundamental)
{
return (from c in coarse
return (from c in fundamental
orderby c.DollarVolume descending
select c.Symbol).Take(100);
}
}</pre>
<pre class="python">class MyCoarseUniverseAlgorithm(QCAlgorithm):
<pre class="python">class MyFundamentalUniverseAlgorithm(QCAlgorithm):
def Initialize(self) -&gt; None:
self.AddUniverse(self.CoarseFilterFunction)
self.AddUniverse(self.FundamentalFilterFunction)

def CoarseFilterFunction(self, coarse: List[CoarseFundamental]) -&gt; List[Symbol]:
sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.DollarVolume, reverse=True)
def FundamentalFilterFunction(self, fundamental: List[Fundamental]) -&gt; List[Symbol]:
sorted_by_dollar_volume = sorted(fundamental, key=lambda x: x.DollarVolume, reverse=True)
return [c.Symbol for c in sorted_by_dollar_volume[:100]]</pre>
</div>

<p>To learn how to define filter functions for other asset classes, <a href='/docs/v2/writing-algorithms/universes/custom-universes'>custom data universes</a>, or <a href='/docs/v2/writing-algorithms/universes/alternative-data-universes'>alternative data universes</a>, see the following pages in this Universes chapter.</p>
<p>To learn how to define filter functions for other asset classes, <a href='/docs/v2/writing-algorithms/universes/custom-universes'>custom data universes</a>, or <a href='/docs/v2/writing-algorithms/universes/equity/alternative-data-universes'>alternative data universes</a>, see the following pages in this Universes chapter.</p>
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@
{
public override void Initialize()
{
AddUniverse(MyCoarseFilterFunction);
AddUniverse(MyFundamentalFilterFunction);
}

IEnumerable&lt;Symbol&gt; MyCoarseFilterFunction(IEnumerable&lt;CoarseFundamental&gt; coarse)
IEnumerable&lt;Symbol&gt; MyFundamentalFilterFunction(IEnumerable&lt;Fundamental&gt; fundamental)
{
return Universe.Unchanged;
return Universe.Unchanged;
}
}
</pre>
}</pre>
<pre class="python">
class MyUniverseAlgorithm(QCAlgorithm):
def Initialize(self) -&gt; None:
self.AddUniverse(self.MyCoarseFilterFunction)
def Initialize(self) -&gt; None:
self.AddUniverse(self.MyFundamentalFilterFunction)

def MyCoarseFilterFunction(self, coarse: List[CoarseFundamental]) -&gt; List[Symbol]:
return Universe.Unchanged</pre>
def MyFundamentalFilterFunction(self, fundamental: List[Fundamental]) -&gt; List[Symbol]:
return Universe.Unchanged</pre>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<pre class="csharp">private Universe _universe;

// In Initialize
_universe = AddUniverse(MyCoarseFilterFunction);
_universe = AddUniverse(MyFundamentalFilterFunction);

// In OnData
var universeMembers = UniverseManager[_universe.Configuration.Symbol].Members;
Expand All @@ -14,12 +14,11 @@
var security = kvp.Value;
}</pre>
<pre class="python"># In Initialize
self.universe = self.AddUniverse(self.MyCoarseFilterFunction)
self.universe = self.AddUniverse(self.MyFundamentalFilterFunction)

# In OnData
universe_members = self.UniverseManager[self.universe.Configuration.Symbol].Members
for kvp in universe_members:
symbol = kvp.Key
security = kvp.Value
</pre>
security = kvp.Value</pre>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</p>
<div class="section-example-container">
<pre class="csharp">// Take the top 50 by dollar volume using coarse
<pre class="csharp">// Take the top 50 by dollar volume using fundamental
// Then the top 10 by PERatio using fine
AddUniverse(
fundamental =&gt; (from f in fundamental
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<? include(DOCS_RESOURCES."/data-feeds/us-equities/fundamental-data-availability.html"); ?>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<meta name="tag" content="universes">
<meta name="tag" content="coarse universes">
<meta name="tag" content="fundamental universes">
<p>The following examples are typical filter functions you may want.<br></p>
<h4>Example 1: Take 500 stocks that are worth more than $10 and have more than $10M daily trading volume</h4>
<p>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "metadata",
"values": {
"description": "You can select a universe based on the constituents of an ETF, and then you can further filter your universe down with fundamentals.",
"keywords": "ETF constituents",
"og:description": "You can select a universe based on the constituents of an ETF, and then you can further filter your universe down with fundamentals.",
"og:title": "Equity - Documentation QuantConnect.com",
"og:type": "website",
"og:site_name": "Equity - QuantConnect.com",
"og:image": "https://cdn.quantconnect.com/docs/i/writing-algorithms/universes/equity.png"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<meta name="tag" content="fundamental universes">
<meta name="tag" content="alternative data universes">
<p>
The following example chains a <a href='/docs/v2/writing-algorithms/universes/equity#05-Fundamentals-Selection'>fundamental universe</a> and an <a href='/docs/v2/writing-algorithms/universes/equity#04-ETF-Constituents-Selection'>ETF constituents universe</a>.
The following example chains a <a href='/docs/v2/writing-algorithms/universes/equity/fundamental-universes'>fundamental universe</a> and an <a href='/docs/v2/writing-algorithms/universes/equity/etf-constituents-universes'>ETF constituents universe</a>.
It first selects all the constituents of the QQQ ETF and then filters then down to select the 20 assets with the lowest PE ratio.
The output of the fundamental universe selection method is the output of the chained universe.
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>
The following example chains an <a href="/docs/v2/writing-algorithms/universes/equity#04-ETF-Constituents-Selection">ETF universe</a> and a <a href='/docs/v2/writing-algorithms/datasets/quiver-quantitative/twitter-followers#09-Universe-Selection'>QuiverQuantTwitterFollowersUniverse alternative universe</a>.
The following example chains an <a href="/docs/v2/writing-algorithms/universes/equity/etf-constituents-universes">ETF universe</a> and a <a href='/docs/v2/writing-algorithms/datasets/quiver-quantitative/twitter-followers#09-Universe-Selection'>QuiverQuantTwitterFollowersUniverse alternative universe</a>.
It first selects all constituents of SPY and then filters them down with based on their Twitter followers number and weekly change.
The output of the alternative universe selection method is the output of the chained universe.
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>
The following example chains an <a href='/docs/v2/writing-algorithms/universes/equity#04-ETF-Constituents-Selection'>ETF constituents universe</a> and an <a href='/docs/v2/writing-algorithms/universes/equity-options'>Equity Options universe</a>.
The following example chains an <a href='/docs/v2/writing-algorithms/universes/equity/etf-constituents-universes'>ETF constituents universe</a> and an <a href='/docs/v2/writing-algorithms/universes/equity-options'>Equity Options universe</a>.
It first selects the 30 largest-weighted constituents of QQQ and then selects their call Option contracts that expire within 60 days.
The output of both universes is the output of the chained universe.
</p>
Expand Down

This file was deleted.

Loading

0 comments on commit 77decf4

Please sign in to comment.