What is the best way to select a group of stocks that are reaching new all times highs.
I try something like this but its consume too much CPU with more than 400 sids.
h_close = history(9999, '1d', 'open_price', ffill=True)
high_pct = h_close[sid][-1] / max(h_close[sid]) - 1
Maybe the best way is using pipeline but i'm a little lost with the implementation.
Thanks,