Can somebody give me a hand to make my_filter working.
full_list = QTradableStocksUS()
excludes = Q500US()
my_filter = [x for x in full_list if x not in excludes]
Can somebody give me a hand to make my_filter working.
full_list = QTradableStocksUS()
excludes = Q500US()
my_filter = [x for x in full_list if x not in excludes]
I believe this is what you are looking for?
full_list = QTradableStocksUS()
excludes = Q500US()
my_filter = full_list & ~excludes
Or, all in one line...
my_filter = QTradableStocksUS() & ~Q500US()
Take a look at the documentation for the operators that can be used on filters https://www.quantopian.com/help#quantopian_pipeline_filters_Filter