Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to get stocks in SP500 index at a given time

    Support
    1
    1
    16
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      buyers_are_back last edited by buyers_are_back

      The data has more than 500 stocks. I know it includes stocks that used to belong to SP500. For instance for (2026, 2, 24):

      from qnt.data import stocks_load_spx_list
      len(stocks_load_spx_list(min_date='2026-02-24', max_date='2026-02-24'))
      

      gives 842.

      Filtering NaNs gives me 658 stocks, which is still more than 500.

      For a given date, I'd like to exclude the weights for those that are out (no forward-looking involved).

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB | Contributors
      • Documentation
      • About
      • Career
      • My account
      • Privacy policy
      • Terms and Conditions
      • Cookies policy
      Home
      Copyright © 2014 - 2021 Quantiacs LLC.
      Powered by NodeBB | Contributors