def __init__(self, start=start_default, end=end_default):
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            _all_days = date_range(start, end, freq=self.day, tz='UTC')

        self._lunch_break_starts = days_at_time(_all_days, lunch_break_start,
                                                self.tz, 0)
        self._lunch_break_ends = days_at_time(_all_days, lunch_break_end,
                                              self.tz, 0)

        TradingCalendar.__init__(self, start=start_default, end=end_default)

        self.schedule = pd.DataFrame(
            index=_all_days,
            columns=[
                'market_open', 'market_close', 'lunch_break_start',
                'lunch_break_end'
            ],
            data={
                'market_open': self._opens,
                'market_close': self._closes,
                'lunch_break_start': self._lunch_break_starts,
                'lunch_break_end': self._lunch_break_ends
            },
            dtype='datetime64[ns]',
        )
예제 #2
0
    def __init__(self, start=start_default, end=end_default):
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            _all_days = date_range(start, end, freq=self.day, tz='UTC')

        self._lunch_break_starts = days_at_time(_all_days, lunch_break_start, self.tz, 0)
        self._lunch_break_ends = days_at_time(_all_days, lunch_break_end, self.tz, 0)

        TradingCalendar.__init__(self, start=start_default, end=end_default)