def get_first_trading_day_of_month(self, dt): self.month = dt.month dt = dt.replace(day=1) first_day = (normalize_date(dt) if self.cal.is_open_on_day(dt) else self.cal.next_trading_day(dt)) return first_day
def test_nyse_data_availability_time(self): """ Ensure that the NYSE schedule's data availability time is the market open. """ # This is a time on the day after Thanksgiving when the market was open test_dt = Timestamp('11/23/2012 11:00AM', tz='EST') test_date = normalize_date(test_dt) desired_data_time = Timestamp('11/23/2012 9:31AM', tz='EST') # Get the data availability time from the NYSE schedule data_time = self.nyse_exchange_schedule.data_availability_time( date=test_date ) # Check the schedule answer against the hard-coded answer self.assertEqual(data_time, desired_data_time, "Data availability time is not the market open")
def should_trigger(self, dt): return self.get_trigger_day_of_month(dt) == normalize_date(dt)
def should_trigger(self, dt): return normalize_date(dt) not in self.cal.early_closes