Trying to get S&P1500 Constituents

Hi: I used code supplied to get 3 available indices: S&P 500, 400 and 600.... but I only get 1347 names for a recent date. Why are so many names from S&P 1500 not qualified? What makes a symbol qualified? Or is something else stopping the full list from downloading? Thanks! Paul

from cloudquant.interfaces import Strategy

why only 1347 stocks in 1500???

class multiple_GUID(Strategy):

########################################################################################
#
# high level strategy - start/finish
#
########################################################################################

# called when the strategy starts (aka before anything else)
@classmethod
def on_strategy_start(cls, md, service, account):
    pass

# called when the strategy finish (aka after everything else has stopped)
@classmethod
def on_strategy_finish(cls, md, service, account):
    pass  

@classmethod
def is_symbol_qualified(cls, symbol, md, service, account):
    SP500 = '9a802d98-a2d7-4326-af64-cea18f8b5d61'
    SP400 = '552dd08d-061d-49c9-a562-343e61fc0893'
    SP600 = '5d414bb9-0154-46f8-8a12-f80430c7cbca'
    SP1500_list = [SP500,SP400,SP600]
    SP1500_name_list = ['SP500','SP400','SP600']
    handle_list = map(service.symbol_list.get_handle,SP1500_list)
    for this_name,this_handle in zip(SP1500_name_list, handle_list):
        if service.symbol_list.in_list(this_handle,symbol):
            print(symbol+' in list: '+this_name)
            return True
    return False
Sign In or Register to comment.