Newbie Question How to set trading universe to SP500 (at least the symbols, no fundamentals) and will it be dynamic when you backtest ?
Newbie Question How to set trading universe to SP500 (at least the symbols, no fundamentals) and will it be dynamic when you backtest ?
Try Q500US:
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline, factors, filters
def initialize(context):
attach_pipeline(Pipeline(screen = filters.Q500US()), 'Q500US')
def before_trading_start(context, data):
context.stocks = pipeline_output('Q500US')
print len(context.stocks)
It will dynamically updating symbols.