I'm writing a combination of mean reversion and momentum and wondering if anyone had ideas about how to avoid companies that have either recently IPO'd or released earnings either that day or the day before. Basically, these are external events that cause me to usually take big losses. I am already using set_universe, but recent IPO's are appearing. I would like to avoid these companies because they are so volatile. I would like to avoid companies that have just reported earnings as well due to the volatile nature there as well.
I look forward to hearing everyone's ideas about how to approach this. One thing I am contemplating is an if statement to exclude companies with a starting trade date before x. However, I am stumped on the earnings problem. I would like to wait at least 2 hours after an earnings release before trading the stock.