def get_symbols(low,high):
assets = api.list_assets()
symbols = [asset.symbol for asset in assets if asset.tradable]
selected=[]
for symbol in symbols:
barset=api.get_barset(symbol,‘day’,limit=1)
bars = barset[symbol]
if bars[0].c >= low and bars[0].c<=high:
selected.append(symbol)
print (symbol,bars[-1].c)
return selected
1 Like
coins
August 7, 2019, 9:44pm
2
Take a look at the momentum example on github. It has an example of filtering stocks by price and volume.
for symbol in symbols:
minute_history[symbol] = api.polygon.historic_agg(
size="minute", symbol=symbol, limit=1000
).df
c += 1
print('{}/{}'.format(c, len(symbols)))
print('Success.')
return minute_history
def get_tickers():
print('Getting current ticker data...')
tickers = api.polygon.all_tickers()
print('Success.')
assets = api.list_assets()
symbols = [asset.symbol for asset in assets if asset.tradable]
return [ticker for ticker in tickers if (
ticker.ticker in symbols and
ticker.lastTrade['p'] >= min_share_price and
ticker.lastTrade['p'] <= max_share_price and
ticker.prevDay['v'] * ticker.lastTrade['p'] > min_last_dv and
1 Like
coins:
def get_tickers():
print(‘Getting current ticker data…’)
tickers = api.polygon.all_tickers()
print(‘Success.’)
assets = api.list_assets()
symbols = [asset.symbol for asset in assets if asset.tradable]
return [ticker for ticker in tickers if (
ticker.ticker in symbols and
ticker.lastTrade[‘p’] >= m
I think i read polygon api wont work in paper trade
trevor
August 9, 2019, 4:03pm
4
Polygon will work even with paper trading keys, so long as you have a funded brokerage account.
tcj2001:
def get_symbols(low,high):
assets = api.list_assets()
symbols = [asset.symbol for asset in assets if asset.tradable]
selected=
for symbol in symbols:
barset=api.get_barset(symbol,‘day’,limit=1)
bars = barset[symbol]
if bars[0].c >= low and bars[0].c<=high:
selected.append(symbol)
print (symbol,bars[-1].c)
return selected
@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.
kris
September 15, 2019, 1:51pm
6
Look into finviz i made a simple login and excel file grabber that imported all to a mysql table