I want to loop through the stocks universe inside the initialize function, I am already looping inside this function using context.stocks = [sid()...]
but I want to benefit from the set_universe function, I have to do this inside initialize because I am instantiating class objects
def initialize(context):
set_universe(universe.DollarVolumeUniverse(floor_percentile=90, ceiling_percentile=90.2)
context.stocks = [sid(24),sid(114)] # it is bigger list than this # I want to replace this with the set_universe
context.algos = [class(stock) for stock in context.stocks]
Data variable is not available in initialize scope
schedule function is not an option because each instance is holding class variables, so it must be instantiating once only
Thank you