update list
This commit is contained in:
parent
d06859e3c0
commit
15d725b865
@ -16,11 +16,7 @@ headers = {"accept": "application/json"}
|
|||||||
|
|
||||||
def check_market_hours():
|
def check_market_hours():
|
||||||
|
|
||||||
holidays = [
|
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']
|
||||||
"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"
|
|
||||||
]
|
|
||||||
|
|
||||||
# Get the current date and time in ET (Eastern Time)
|
# Get the current date and time in ET (Eastern Time)
|
||||||
et_timezone = pytz.timezone('America/New_York')
|
et_timezone = pytz.timezone('America/New_York')
|
||||||
@ -402,38 +398,23 @@ async def run():
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open("json/options-flow/feed/data.json", 'r') as file:
|
with open("json/stocks-list/list/highest-open-interest-change.json", 'r') as file:
|
||||||
options_flow = ujson.load(file)
|
highest_open_interest_change = ujson.load(file)[:3]
|
||||||
|
|
||||||
# Filter the options_flow to include only items with ticker in total_symbol
|
with open("json/stocks-list/list/highest-option-iv-rank.json", 'r') as file:
|
||||||
options_flow = [item for item in options_flow if item['ticker'] in stock_symbols]
|
highest_iv_rank = ujson.load(file)[:3]
|
||||||
|
|
||||||
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)
|
with open("json/stocks-list/list/highest-option-premium.json", 'r') as file:
|
||||||
highest_premium = [
|
highest_premium = ujson.load(file)[:3]
|
||||||
{key: item[key] for key in ['cost_basis', 'ticker', 'underlying_type', 'date_expiration', 'put_call', 'volume', 'strike_price']}
|
optionsData = {
|
||||||
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 = {
|
|
||||||
'premium': highest_premium,
|
'premium': highest_premium,
|
||||||
'volume': highest_volume,
|
'ivRank': highest_iv_rank,
|
||||||
'openInterest': highest_open_interest
|
'openInterest': highest_open_interest_change
|
||||||
}
|
}
|
||||||
|
print(optionsData)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
options_flow = {}
|
optionsData = {}
|
||||||
|
|
||||||
market_status = check_market_hours()
|
market_status = check_market_hours()
|
||||||
if market_status == 0:
|
if market_status == 0:
|
||||||
@ -492,7 +473,7 @@ async def run():
|
|||||||
data = {
|
data = {
|
||||||
'marketMovers': market_movers,
|
'marketMovers': market_movers,
|
||||||
'marketStatus': market_status,
|
'marketStatus': market_status,
|
||||||
'optionsFlow': options_flow,
|
'optionsData': optionsData,
|
||||||
'recentEarnings': recent_earnings,
|
'recentEarnings': recent_earnings,
|
||||||
'upcomingEarnings': upcoming_earnings,
|
'upcomingEarnings': upcoming_earnings,
|
||||||
'analystReport': recent_analyst_report,
|
'analystReport': recent_analyst_report,
|
||||||
|
|||||||
@ -692,8 +692,11 @@ async def get_highest_oi_change():
|
|||||||
for symbol in symbols:
|
for symbol in symbols:
|
||||||
try:
|
try:
|
||||||
# Load quote data from JSON file
|
# 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)
|
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:
|
if change_oi > 0 and total_oi > 0:
|
||||||
quote_data = await get_quote_data(symbol)
|
quote_data = await get_quote_data(symbol)
|
||||||
# Assign price and volume, and check if they meet the penny stock criteria
|
# Assign price and volume, and check if they meet the penny stock criteria
|
||||||
@ -710,9 +713,10 @@ async def get_highest_oi_change():
|
|||||||
'name': name,
|
'name': name,
|
||||||
'price': price,
|
'price': price,
|
||||||
'changesPercentage': changesPercentage,
|
'changesPercentage': changesPercentage,
|
||||||
'changeOI': change_oi,
|
'ivRank': iv_rank,
|
||||||
|
'totalPrem': total_prem,
|
||||||
'totalOI': total_oi,
|
'totalOI': total_oi,
|
||||||
'marketCap': market_cap,
|
'changeOI': change_oi,
|
||||||
})
|
})
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -749,8 +753,10 @@ async def get_highest_option_iv_rank():
|
|||||||
for symbol in symbols:
|
for symbol in symbols:
|
||||||
try:
|
try:
|
||||||
# Load quote data from JSON file
|
# 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)
|
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:
|
if total_oi > 1E6 and iv_rank > 0:
|
||||||
quote_data = await get_quote_data(symbol)
|
quote_data = await get_quote_data(symbol)
|
||||||
@ -769,8 +775,9 @@ async def get_highest_option_iv_rank():
|
|||||||
'price': price,
|
'price': price,
|
||||||
'changesPercentage': changesPercentage,
|
'changesPercentage': changesPercentage,
|
||||||
'ivRank': iv_rank,
|
'ivRank': iv_rank,
|
||||||
|
'totalPrem': total_prem,
|
||||||
'totalOI': total_oi,
|
'totalOI': total_oi,
|
||||||
'marketCap': market_cap,
|
'changeOI': change_oi,
|
||||||
})
|
})
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -800,6 +807,8 @@ async def get_highest_option_premium():
|
|||||||
# Load quote data from JSON file
|
# Load quote data from JSON file
|
||||||
iv_rank = stock_screener_data_dict[symbol].get('ivRank',0)
|
iv_rank = stock_screener_data_dict[symbol].get('ivRank',0)
|
||||||
total_prem = stock_screener_data_dict[symbol].get('totalPrem',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:
|
if total_prem > 0 and iv_rank > 0:
|
||||||
quote_data = await get_quote_data(symbol)
|
quote_data = await get_quote_data(symbol)
|
||||||
@ -819,7 +828,8 @@ async def get_highest_option_premium():
|
|||||||
'changesPercentage': changesPercentage,
|
'changesPercentage': changesPercentage,
|
||||||
'ivRank': iv_rank,
|
'ivRank': iv_rank,
|
||||||
'totalPrem': total_prem,
|
'totalPrem': total_prem,
|
||||||
'marketCap': market_cap,
|
'totalOI': total_oi,
|
||||||
|
'changeOI': change_oi,
|
||||||
})
|
})
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user