bugfixing

This commit is contained in:
MuslemRahimi 2025-01-02 00:15:42 +01:00
parent e609d05159
commit 169b78c3cf
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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: