Skip to content

Instantly share code, notes, and snippets.

@under0tech
Created September 26, 2022 17:42
Show Gist options
  • Save under0tech/df0bf8f5893ebff31968fdbef163fc80 to your computer and use it in GitHub Desktop.
Save under0tech/df0bf8f5893ebff31968fdbef163fc80 to your computer and use it in GitHub Desktop.
# Screen stocks
def ScreenStocks(trader_api):
assets = trader_api.list_assets(status='active', asset_class='us_equity')
assets = [x for x in assets if x.shortable == True and x.exchange == 'NASDAQ']
stocks = [x.symbol for x in assets][:SCREENER_NASDAQ_COUNT]
screened = []
for st in stocks:
_stock = CheckStock(st)
if _stock != {}:
screened.append(_stock)
screened = [x for x in screened if abs(x['stop_loss'] - x['take_profit']) > min(x['stop_loss'], x['take_profit']) * TAKE_PROFIT_DELTA]
return screened
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment