Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Popular
    Log in to post
    • All categories
    • Support
    •      Request New Features
    • Strategy help
    • General Discussion
    • News and Feature Releases
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month
    • B

      How to get stocks in SP500 index at a given time
      Support • • buyers_are_back

      2
      0
      Votes
      2
      Posts
      52
      Views

      S

      @buyers_are_back Hi,

      You can use is_liquid field from spx dataset to filter out weights allocated to not members of S&P500 at given point in time:

      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)

      The number 842 represents total number of assets that have been members of S&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.

      To get the list of index members on certain date, just filter is_liquid field:

      ### 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
    • V

      No output showing for my submitted strategy
      Support • • vg2001

      2
      0
      Votes
      2
      Posts
      165
      Views

      support

      @vg2001 It has been fixed, sorry

    • B

      publish my Quantiacs strategy on GitHub
      Support • • black.magmar

      1
      0
      Votes
      1
      Posts
      13
      Views

      No one has replied

    • L

      Complete Guide, Features, Requirements & Installation Steps
      Request New Features • • lime.tauros

      1
      0
      Votes
      1
      Posts
      11
      Views

      No one has replied

    • O

      Unhelpful leaderboard
      Support • • optical.turtle

      1
      0
      Votes
      1
      Posts
      34
      Views

      No one has replied

    • Documentation
    • About
    • Career
    • My account
    • Privacy policy
    • Terms and Conditions
    • Cookies policy
    Home
    Copyright © 2014 - 2021 Quantiacs LLC.
    Powered by NodeBB | Contributors