Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to get Static Assets in Research?

Hi guys,

I am trying to do research on ETFs and have been using
( universe=Filters.StaticAssets(context.stock) where context.stock={9 etfs})
in algorithm mode.

How would I use this in research so I can see how my strategy works with etfs?

Thanks,

Eric

1 response

Use StaticAssets in a notebook the same way you would in an algorithm.


# import StaticAssets  
from quantopian.pipeline.filters import  StaticAssets

# Create a static asset filter (here we want only the ETFs SPY and TLT  
my_etfs = StaticAssets(symbols(['SPY', 'TLT']))

# Use the filter as a screen when making a pipe definition or as a mask in a factor  
myPipe=Pipeline(  
        columns={"factor": factor,  
                 "ma_cross": ma_cross,  
                 },  
        screen = my_etfs  
        )

See attached notebook with it in action.