<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to get stocks in SP500 index at a given time]]></title><description><![CDATA[<p dir="auto">The data has more than 500 stocks. I know it includes stocks that used to belong to SP500. For instance for (2026, 2, 24):</p>
<pre><code>from qnt.data import stocks_load_spx_list
len(stocks_load_spx_list(min_date='2026-02-24', max_date='2026-02-24'))
</code></pre>
<p dir="auto">gives 842.</p>
<p dir="auto">Filtering NaNs gives me 658 stocks, which is still more than 500.</p>
<p dir="auto">For a given date, I'd like to exclude the weights for those that are out (no forward-looking involved).</p>
]]></description><link>http://quantiacs.com/community/topic/781/how-to-get-stocks-in-sp500-index-at-a-given-time</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 19:04:21 GMT</lastBuildDate><atom:link href="http://quantiacs.com/community/topic/781.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Apr 2026 17:28:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get stocks in SP500 index at a given time on Wed, 10 Jun 2026 11:10:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/2548">@buyers_are_back</a> Hi,</p>
<p dir="auto">Regarding your first question, yes, that is correct. As we look more into the past, it is more difficult to get data for companies which have been index members but don't exist anymore, for example. This is also related to your second question - symbols with '~1' are in almost all cases, the same companies with the same ticker symbol, but with different ISIN (International Securities Identification Number). For instance, SanDisk company ("NAS:SNDK") was standalone public company until 2016,  when Western Digital acquired SanDisk. In 2025 company spinoff,  SanDisk re-emerged on the Nasdaq as an independent public company, with the same ticker as it was ('SNDK'), but with different ISIN (considered as different company).<br />
Those symbol pairs, should not have an intersection in membership ("is_liquid" field should not be 1.0 for both at the same time), otherwise it could be mistake by provider.</p>
]]></description><link>http://quantiacs.com/community/post/2143</link><guid isPermaLink="true">http://quantiacs.com/community/post/2143</guid><dc:creator><![CDATA[stefanm]]></dc:creator><pubDate>Wed, 10 Jun 2026 11:10:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to get stocks in SP500 index at a given time on Sat, 16 May 2026 20:23:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/229">@stefanm</a> said in <a href="/community/post/2121">How to get stocks in SP500 index at a given time</a>:</p>
<blockquote>
<p dir="auto">is_liquid_spec = is_liquid.sel(time=date)<br />
members_spec = is_liquid_spec.coords["asset"][is_liquid_spec == 1.0].asset.values</p>
</blockquote>
<p dir="auto">Thanks for the reply! I have some further questions.</p>
<ol>
<li>Is it the case that the dataset does not contain all symbols in the index? If I plot the number of stocks it started from around 350 then increases to 500.</li>
</ol>
<p dir="auto"><img src="/community/assets/uploads/files/1778962794644-c80c9110-826a-4349-8125-f3641fad0e09-image.png" alt="c80c9110-826a-4349-8125-f3641fad0e09-image.png" class="img-responsive img-markdown" /></p>
<ol start="2">
<li>There are some symbols and their counterparts with suffix <code>~1</code>, for instance <code>NAS:FISV</code> and <code>NAS:FISV~1</code>, what does it mean?</li>
</ol>
<p dir="auto"><img src="/community/assets/uploads/files/1778962826662-f16737ac-577b-44ea-b698-fdd1164f4dd9-image.png" alt="f16737ac-577b-44ea-b698-fdd1164f4dd9-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://quantiacs.com/community/post/2137</link><guid isPermaLink="true">http://quantiacs.com/community/post/2137</guid><dc:creator><![CDATA[buyers_are_back]]></dc:creator><pubDate>Sat, 16 May 2026 20:23:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to get stocks in SP500 index at a given time on Thu, 09 Apr 2026 10:49:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/2548">@buyers_are_back</a> Hi,</p>
<p dir="auto">You can use  <code>is_liquid</code> field from spx dataset to filter out weights allocated to not members of S&amp;P500 at given point in time:</p>
<pre><code class="language-python">from qnt.data import stocks_load_spx_data

spx_data = stocks_load_spx_data(min_date="2006-01-01")
is_liquid = spx_data.sel(field="is_liquid")
final_weights = your_weights * is_liquid
### weights for given date (weights_spec)
date = "2026-02-24"
weights_spec = final_weights.sel(time=date)
</code></pre>
<p dir="auto">The number 842 represents total number of assets that have been members of S&amp;P500 index at some point in time (from given dataset), and 658 shows number of assets that are still active on market (have OHLC prices), but only ~500 are index constituents in that point in time.</p>
<p dir="auto">To get the list of index members on certain date, just filter <code>is_liquid</code> field:</p>
<pre><code class="language-python">### liquidity field values for given date
is_liquid_spec = is_liquid.sel(time=date)
members_spec = is_liquid_spec.coords["asset"][is_liquid_spec == 1.0].asset.values</code></pre>
]]></description><link>http://quantiacs.com/community/post/2121</link><guid isPermaLink="true">http://quantiacs.com/community/post/2121</guid><dc:creator><![CDATA[stefanm]]></dc:creator><pubDate>Thu, 09 Apr 2026 10:49:49 GMT</pubDate></item></channel></rss>