bugfixing market movers

This commit is contained in:
MuslemRahimi 2024-10-16 22:58:43 +02:00
parent 64967207c3
commit 6b931be507

View File

@ -273,7 +273,10 @@ async def get_pre_post_market_movers(symbols):
changes_percentage = pre_post_data.get("changesPercentage", None)
with open(f"json/one-day-price/{symbol}.json", 'rb') as file:
one_day_price = ujson.load(file)
if price and changes_percentage and len(one_day_price) > 300:
# Filter out entries where 'close' is None
filtered_prices = [price for price in one_day_price if price['close'] is not None]
if price and changes_percentage and len(filtered_prices) > 300:
res_list.append({
"symbol": symbol,
"name": name,