From fc2964f7ebffc1335f057925da78c282f4d0a14a Mon Sep 17 00:00:00 2001 From: vanalmsick <44527602+vanalmsick@users.noreply.github.com> Date: Wed, 21 May 2025 18:12:37 +0100 Subject: [PATCH] Only exclude penny stocks (GBp) from Top 5 most active. #patch --- markets/scrape.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)