Equities without ETFs/ETNs

fg327962fg327962 Posts: 4
edited July 2017 in Portfolio Construction

Hello, a newbie here.

I need to use as initial universe the list of items in NYSE/AMEX excluding those in ETFs, ETNs

Being a newcomer to python, so far I couldn't solve the problem.

Please, Can you help me?

Thanks

Francisco

Comments

  • shayneshayne Posts: 70

    Francisco,

    Give this a try ...

        @classmethod
        def is_symbol_qualified(cls, symbol, md, service, account):
            nyse_amex = service.symbol_list.get_handle('9389dd95-ca7e-4fe2-b2a6-329ce7de4665') # NYSE/AMEX combined
            etfs = service.symbol_list.get_handle('82e8721e-d9fe-4ac4-b597-5197a4309a60') # ETF's
            etns = service.symbol_list.get_handle('c3544f64-41f2-4744-bde6-dd742384c844') # ETN's
            return (service.symbol_list.in_list(nyse_amex, symbol)) and (not service.symbol_list.in_list(etfs, symbol)) and (not service.symbol_list.in_list(etns, symbol)) 
    

    Check https://app.cloudquant.com/#/glossary/365 for more information about available lists

  • fg327962fg327962 Posts: 4

    Thanks a lot!!

Sign In or Register to comment.