diff --git a/markets/scrape.py b/markets/scrape.py index c62d6ab..58e8163 100644 --- a/markets/scrape.py +++ b/markets/scrape.py @@ -169,7 +169,8 @@ def active_gainers_loosers(): top5 = top5[top5["priceAge"] < 60 * 60 * 6] # exclude quotes where the market closed more than 6 hours ago exclude_tickers = os.getenv("EXCLUDE_TICKERS", "").upper().split(",") top5 = top5[~(top5["symbol"].isin(exclude_tickers))] # remove DQ stocks - top5 = top5[~(top5["currency"].isin(['GBp']) & (top5["regularMarketPrice"] < 10 * 100))] # exclude penny stocks less than 10 GBP + if sortField == "dayvolume": + top5 = top5[~(top5["currency"].isin(['GBp']) & (top5["regularMarketPrice"] < 10 * 100))] # exclude penny stocks less than 10 GBP top5.drop_duplicates(subset=["longName"], inplace=True, keep="first") top5 = top5.iloc[: min(len(top5), 5)] top5.reset_index(drop=True, inplace=True)