Skip to content

Commit

Permalink
update list
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Jan 6, 2025
1 parent d06859e commit 15d725b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 40 deletions.
49 changes: 15 additions & 34 deletions app/cron_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@

def check_market_hours():

holidays = [
"2024-01-01", "2024-01-15", "2024-02-19", "2024-03-29",
"2024-05-27", "2024-06-19", "2024-07-04", "2024-09-02",
"2024-11-28", "2024-12-25"
]
holidays = ['2025-01-01', '2025-01-09','2025-01-20', '2025-02-17', '2025-04-18', '2025-05-26', '2025-06-19', '2025-07-04', '2025-09-01', '2025-11-27', '2025-12-25']

# Get the current date and time in ET (Eastern Time)
et_timezone = pytz.timezone('America/New_York')
Expand Down Expand Up @@ -402,38 +398,23 @@ async def run():


try:
with open("json/options-flow/feed/data.json", 'r') as file:
options_flow = ujson.load(file)

# Filter the options_flow to include only items with ticker in total_symbol
options_flow = [item for item in options_flow if item['ticker'] in stock_symbols]

highest_volume = sorted(options_flow, key=lambda x: int(x['volume']), reverse=True)
highest_volume = [
{key: item[key] for key in ['cost_basis', 'ticker', 'underlying_type', 'date_expiration', 'put_call', 'volume', 'strike_price']}
for item in highest_volume[0:4]
]

highest_premium = sorted(options_flow, key=lambda x: int(x['cost_basis']), reverse=True)
highest_premium = [
{key: item[key] for key in ['cost_basis', 'ticker', 'underlying_type', 'date_expiration', 'put_call', 'volume', 'strike_price']}
for item in highest_premium[0:4]
]

highest_open_interest = sorted(options_flow, key=lambda x: int(x['open_interest']), reverse=True)
highest_open_interest = [
{key: item[key] for key in ['cost_basis', 'ticker', 'underlying_type', 'date_expiration', 'put_call', 'open_interest', 'strike_price']}
for item in highest_open_interest[0:4]
]

options_flow = {
with open("json/stocks-list/list/highest-open-interest-change.json", 'r') as file:
highest_open_interest_change = ujson.load(file)[:3]

with open("json/stocks-list/list/highest-option-iv-rank.json", 'r') as file:
highest_iv_rank = ujson.load(file)[:3]

with open("json/stocks-list/list/highest-option-premium.json", 'r') as file:
highest_premium = ujson.load(file)[:3]
optionsData = {
'premium': highest_premium,
'volume': highest_volume,
'openInterest': highest_open_interest
'ivRank': highest_iv_rank,
'openInterest': highest_open_interest_change
}
print(optionsData)
except Exception as e:
print(e)
options_flow = {}
optionsData = {}

market_status = check_market_hours()
if market_status == 0:
Expand Down Expand Up @@ -492,7 +473,7 @@ async def run():
data = {
'marketMovers': market_movers,
'marketStatus': market_status,
'optionsFlow': options_flow,
'optionsData': optionsData,
'recentEarnings': recent_earnings,
'upcomingEarnings': upcoming_earnings,
'analystReport': recent_analyst_report,
Expand Down
22 changes: 16 additions & 6 deletions app/cron_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,11 @@ async def get_highest_oi_change():
for symbol in symbols:
try:
# Load quote data from JSON file
change_oi = stock_screener_data_dict[symbol].get('changeOI',0)
iv_rank = stock_screener_data_dict[symbol].get('ivRank',0)
total_prem = stock_screener_data_dict[symbol].get('totalPrem',0)
total_oi = stock_screener_data_dict[symbol].get('totalOI',0)
change_oi = stock_screener_data_dict[symbol].get('changeOI',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
Expand All @@ -710,9 +713,10 @@ async def get_highest_oi_change():
'name': name,
'price': price,
'changesPercentage': changesPercentage,
'changeOI': change_oi,
'ivRank': iv_rank,
'totalPrem': total_prem,
'totalOI': total_oi,
'marketCap': market_cap,
'changeOI': change_oi,
})
except:
pass
Expand Down Expand Up @@ -749,8 +753,10 @@ async def get_highest_option_iv_rank():
for symbol in symbols:
try:
# Load quote data from JSON file
total_oi = stock_screener_data_dict[symbol].get('totalOI',0)
iv_rank = stock_screener_data_dict[symbol].get('ivRank',0)
total_prem = stock_screener_data_dict[symbol].get('totalPrem',0)
total_oi = stock_screener_data_dict[symbol].get('totalOI',0)
change_oi = stock_screener_data_dict[symbol].get('changeOI',0)

if total_oi > 1E6 and iv_rank > 0:
quote_data = await get_quote_data(symbol)
Expand All @@ -769,8 +775,9 @@ async def get_highest_option_iv_rank():
'price': price,
'changesPercentage': changesPercentage,
'ivRank': iv_rank,
'totalPrem': total_prem,
'totalOI': total_oi,
'marketCap': market_cap,
'changeOI': change_oi,
})
except:
pass
Expand Down Expand Up @@ -800,6 +807,8 @@ async def get_highest_option_premium():
# Load quote data from JSON file
iv_rank = stock_screener_data_dict[symbol].get('ivRank',0)
total_prem = stock_screener_data_dict[symbol].get('totalPrem',0)
total_oi = stock_screener_data_dict[symbol].get('totalOI',0)
change_oi = stock_screener_data_dict[symbol].get('changeOI',0)

if total_prem > 0 and iv_rank > 0:
quote_data = await get_quote_data(symbol)
Expand All @@ -819,7 +828,8 @@ async def get_highest_option_premium():
'changesPercentage': changesPercentage,
'ivRank': iv_rank,
'totalPrem': total_prem,
'marketCap': market_cap,
'totalOI': total_oi,
'changeOI': change_oi,
})
except:
pass
Expand Down

0 comments on commit 15d725b

Please sign in to comment.