Hello everyone,

I was wondering what the best way would be to filter equities in a Universe by returns over the past 12 months would be. Should I just perform a historical data request and calculate the percent returns manually (in that case, is there a way to request data for only a single day and not a period of time)? Would it be better to use rolling windows for this? Is there some other method? I would appreciate any assistance!

Also, is there some way to stop the algorithm through the API during live trading without having to do it outside of code? Or is there some sort of kill switch I could set up that stops the algorithm and liquidates all held assets?

One final question: How can I access the open and close times for a market instead of just one symbol. I want to schedule a function at 15 minutes before close, and I know I can do this by providing a specific symbol, but I'm using a dynamic Universe, so there is no single symbol that represents what I want to schedule, and the function I want to schedule should only run once (it liquidates the entire portfolio) not for everything in the Universe. Should I just pick an equity in the market I want to schedule around? Is there a better way to schedule this/access the market open/close times? Thanks to anyone who offers advice!