Where can I find the list of all symbols for historical data and their summary data?

If I want to run a strategy that uses 100 of the most liquid ETF's or 200 for which the data is available for the last 5 years, it would be nice to have a table from where I can get it immediately. Otherwise, If I have to run a program with an individual symbol to see it's starting date and, say, trading volume, it would have been an enormous waste of resources and time to answer those particular questions.

Comments

  • shayneshayne Posts: 70

    Try this code for the top 10 ETFs:

    from cloudquant.interfaces import Strategy
    
    class TopSymbols(Strategy):
    
        @classmethod
        def on_strategy_start(cls, md, service, account):
            etf_list = service.symbol_list.get_handle('82e8721e-d9fe-4ac4-b597-5197a4309a60') #etf guid list
    
            symbol_avol = {}
    
            # iterate over the market data
            for md_info in md:
                symbol = md_info.symbol
    
                is_etf = service.symbol_list.in_list(etf_list, symbol)
    
                if is_etf:
                    # add the symbol to the symbol list after it met the if condition
                    symbol_avol[symbol] = md_info.stat.avol
    
            print "ETF's with volume\n", symbol_avol, '\n'
    
            cls.top_qualified_qualified_symbols = [symbol[0] for symbol in sorted(symbol_avol.items(), key=lambda kv: kv[1], reverse=True)][:10]
    
            print "TOP ETF's by volume\n", cls.top_qualified_qualified_symbols, '\n'
    
        @classmethod
        def is_symbol_qualified(cls, symbol, md, service, account):
    
            # qualifies all symbols in cls.top_qualified_qualified_symbols
            return symbol in cls.stop_qualified_qualified_symbols
    
        def on_start(self, md, order, service, account):
            print 'in on_start for ', self.symbol, md.stat.avol
    

    This should find the top etf for the test date. FYI, it depends on the ETF symbol list.

Sign In or Register to comment.