From 169b78c3cf9d81b0ed6d64d0d1780133d3e079a1 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 2 Jan 2025 00:15:42 +0100 Subject: [PATCH] bugfixing --- app/cron_list.py | 7 +++++-- app/restart_json.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/cron_list.py b/app/cron_list.py index 04d51cc..463cbda 100644 --- a/app/cron_list.py +++ b/app/cron_list.py @@ -692,8 +692,9 @@ async def get_hottest_contracts(): for symbol in symbols: try: # Load quote data from JSON file - change_oi = stock_screener_data_dict[symbol].get('changeOI',None) - if change_oi > 0: + change_oi = stock_screener_data_dict[symbol].get('changeOI',0) + total_oi = stock_screener_data_dict[symbol].get('totalOI',0) + if change_oi > 0 and total_oi > 0: quote_data = await get_quote_data(symbol) # Assign price and volume, and check if they meet the penny stock criteria if quote_data: @@ -710,6 +711,8 @@ async def get_hottest_contracts(): 'price': price, 'changesPercentage': changesPercentage, 'changeOI': change_oi, + 'totalOI': total_oi, + 'marketCap': market_cap, }) except: pass diff --git a/app/restart_json.py b/app/restart_json.py index e3e52b1..77f6ed4 100755 --- a/app/restart_json.py +++ b/app/restart_json.py @@ -927,6 +927,7 @@ async def get_stock_screener(con): item['callVolume'] = res['call_volume'] item['putVolume'] = res['put_volume'] item['pcRatio'] = res['put_call_ratio'] + item['totalPrem'] = res['call_premium']+res['put_premium'] except: item['gexRatio'] = None item['ivRank'] = None @@ -938,6 +939,7 @@ async def get_stock_screener(con): item['callVolume'] = None item['putVolume'] = None item['pcRatio'] = None + item['totalPrem'] = None try: