bugfixing holiday
This commit is contained in:
parent
432696d629
commit
f640842c3d
@ -9,8 +9,8 @@ class GetStartEndDate:
|
||||
|
||||
def check_if_holiday(self):
|
||||
holiday_dates = {
|
||||
datetime(2023, 9, 4): 'labor_day',
|
||||
datetime(2023, 9, 5): 'labor_day+1',
|
||||
datetime(2024, 9, 2): 'labor_day',
|
||||
datetime(2024, 9, 3): 'labor_day+1',
|
||||
datetime(2023, 11, 23): 'thanks_giving',
|
||||
datetime(2023, 12, 25): 'christmas',
|
||||
datetime(2024, 1, 1): 'new_year',
|
||||
@ -27,7 +27,7 @@ class GetStartEndDate:
|
||||
|
||||
def correct_1d_interval(self, holiday):
|
||||
if holiday in ('labor_day', 'labor_day+1'):
|
||||
start_date_1d = datetime(2023, 9, 1)
|
||||
start_date_1d = datetime(2024, 8, 30)
|
||||
elif holiday == 'thanks_giving':
|
||||
start_date_1d = datetime(2023, 11, 22)
|
||||
elif holiday == 'new_year':
|
||||
@ -61,8 +61,8 @@ class GetStartEndDate:
|
||||
is_afternoon = current_time_new_york.hour > 9 or (current_time_new_york.hour == 9 and current_time_new_york.minute >= 30)
|
||||
if holiday:
|
||||
holiday_dates = {
|
||||
'labor_day': datetime(2023, 9, 1),
|
||||
'labor_day+1': datetime(2023, 9, 1),
|
||||
'labor_day': datetime(2024, 8, 30),
|
||||
'labor_day+1': datetime(2024, 8, 30),
|
||||
'thanks_giving': datetime(2023, 11, 22),
|
||||
'christmas': datetime(2023, 12, 22),
|
||||
'new_year': datetime(2023, 12, 29),
|
||||
|
||||
@ -303,7 +303,8 @@ async def run():
|
||||
highest_open_interest = [{key: item[key] for key in ['cost_basis', 'ticker','assetType', 'date_expiration', 'put_call', 'open_interest', 'strike_price']} for item in highest_open_interest[0:4]]
|
||||
|
||||
options_flow = {'premium': highest_premium, 'volume': highest_volume, 'openInterest':highest_open_interest}
|
||||
except:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
options_flow = {}
|
||||
try:
|
||||
with open(f"json/wiim/rss-feed/data.json", 'r') as file:
|
||||
|
||||
@ -65,7 +65,8 @@ def process_page(page):
|
||||
page_list.append(item)
|
||||
|
||||
return page_list
|
||||
except:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user