Any efficient way of getting symbols between a price range

def get_symbols(low,high):
assets = api.list_assets()
symbols = [asset.symbol for asset in assets if asset.tradable]
for symbol in symbols:
bars = barset[symbol]
if bars[0].c >= low and bars[0].c<=high:
print (symbol,bars[-1].c)
return selected

1 Like

Take a look at the momentum example on github. It has an example of filtering stocks by price and volume.

1 Like

I think i read polygon api wont work in paper trade

Polygon will work even with paper trading keys, so long as you have a funded brokerage account.

@tcj2001, thanks a lot! Do you know if there is a faster way to do this? Because it actually takes quite a lot of time to run your function for all 8317 IEX tickers.

Look into finviz i made a simple login and excel file grabber that imported all to a mysql table