@@ -29,17 +29,13 @@ class PriceEffect(str, Enum):
2929def now_in_new_york () -> datetime :
3030 """
3131 Gets the current time in the New York timezone.
32-
33- :return: current time as datetime
3432 """
3533 return datetime .now (TZ )
3634
3735
3836def today_in_new_york () -> date :
3937 """
4038 Gets the current date in the New York timezone.
41-
42- :return: current date
4339 """
4440 return now_in_new_york ().date ()
4541
@@ -50,8 +46,6 @@ def is_market_open_on(day: date | None = None) -> bool:
5046 during the given day.
5147
5248 :param day: date to check. If not provided defaults to current NY date.
53-
54- :return: whether the market opens on given day
5549 """
5650 day = day or today_in_new_york ()
5751 date_range = NYSE .valid_days (day , day )
@@ -64,8 +58,6 @@ def get_third_friday(day: date | None = None) -> date:
6458 or the monthly expiration associated with today's month.
6559
6660 :param day: date to check. If not provided defaults to current NY date.
67-
68- :return: the associated monthly
6961 """
7062 day = (day or today_in_new_york ()).replace (day = 1 ) + timedelta (weeks = 2 )
7163 while day .weekday () != 4 : # Friday
@@ -76,8 +68,6 @@ def get_third_friday(day: date | None = None) -> date:
7668def get_tasty_monthly () -> date :
7769 """
7870 Gets the monthly expiration closest to 45 days from the current date.
79-
80- :return: the closest to 45 DTE monthly expiration
8171 """
8272 day = today_in_new_york ()
8373 exp1 = get_third_friday (day + timedelta (weeks = 4 ))
@@ -101,8 +91,6 @@ def get_future_fx_monthly(day: date | None = None) -> date:
10191 Wednesday.
10292
10393 :param day: date to check. If not provided defaults to current NY date.
104-
105- :return: the associated monthly
10694 """
10795 day = (day or today_in_new_york ()).replace (day = 1 ) + timedelta (weeks = 1 )
10896 while day .weekday () != 2 : # Wednesday
@@ -120,8 +108,6 @@ def get_future_treasury_monthly(day: date | None = None) -> date:
120108 business day prior.
121109
122110 :param day: date to check. If not provided defaults to current NY date.
123-
124- :return: the associated monthly
125111 """
126112 day = day or today_in_new_york ()
127113 last_day = _get_last_day_of_month (day )
@@ -143,8 +129,6 @@ def get_future_metal_monthly(day: date | None = None) -> date:
143129 which case they expire on the prior business day.
144130
145131 :param day: date to check. If not provided defaults to current NY date.
146-
147- :return: the associated monthly
148132 """
149133 day = day or today_in_new_york ()
150134 last_day = _get_last_day_of_month (day )
@@ -164,8 +148,6 @@ def get_future_grain_monthly(day: date | None = None) -> date:
164148 least 2 business days, the last business day of the month.
165149
166150 :param day: date to check. If not provided defaults to current NY date.
167-
168- :return: the associated monthly
169151 """
170152 day = day or today_in_new_york ()
171153 last_day = _get_last_day_of_month (day )
@@ -185,8 +167,6 @@ def get_future_oil_monthly(day: date | None = None) -> date:
185167 they expire 7 business days prior to the 25th day of the month.
186168
187169 :param day: date to check. If not provided defaults to current NY date.
188-
189- :return: the associated monthly
190170 """
191171 last_day = (day or today_in_new_york ()).replace (day = 25 )
192172 first_day = last_day .replace (day = 1 )
@@ -201,8 +181,6 @@ def get_future_index_monthly(day: date | None = None) -> date:
201181 month.
202182
203183 :param day: date to check. If not provided defaults to current NY date.
204-
205- :return: the associated monthly
206184 """
207185 day = day or today_in_new_york ()
208186 last_day = _get_last_day_of_month (day )
@@ -224,8 +202,6 @@ def _dasherize(s: str) -> str:
224202 Converts a string from snake case to dasherized.
225203
226204 :param s: string to convert
227-
228- :return: dasherized string
229205 """
230206 return s .replace ("_" , "-" )
231207
0 commit comments