I assume you are using Pipeline API, probably the example here. Right now I can offer a hackish solution for this. We will soon migrate our data infrastructure, where we can offer a more elegant solution.
For the time being, define a custom filter like below that exclude specified assets from scan.
from zipline.pipeline import CustomFilter
def exclude_assets(universe):
class FilteredUniverse(CustomFilter):
inputs = ()
window_length = 1
def compute(self,today,assets,out):
in_universe = [asset not in universe for asset in assets]
out[:] = in_universe
return FilteredUniverse()
Then define a variable somewhere in your
initialize function that lists the symbols to exclude, like below:
context.exclude = [symbol(s) for s in ['NIFTY50']]
Finally, instantiate this filter in your pipeline definiton function (
make_strategy_pipeline in the link)
universe_filter = exclude_assets(context.exclude)
and use this filter in the pipeline
set_screen call (or combine with existing filter), like:
pipe.set_screen(volume_filter & universe_filter)
Hope this solves your problem. You can add or remove symbols from the context.exclude list.