Pinaki,
There is a kind of ridiculous hack to get more than 500 stocks into your universe. You would need to buy one share each of the first 500 the first day, one share each of the second 500 the next day, and so on. So long as you hold positions, then the stocks will be in
data
. Once you get up to 2000, then you could start analyzing which ones to buy at higher levels, based on your X% gap at the open criterion. And you could sell the rest.
Another hack would be to create orders that would never be filled, 500 new stocks per day. This will force the stocks to remain in data
and you can work your magic. The problem, I think, is that it should work for backtesting, but for live trading at IB, all open orders are cancelled at the market close, so I think the next day, the stocks would be flushed from data
when you call update_universe again.
Grant