US Trading Holidays

Use this module to determine if a date or date string is a holiday (future, today or historical should be supported).

Holiday detection for US Markets

Stack Overflow for this module

class analysis_engine.holidays.USTradingCalendar(name=None, rules=None)[source]
analysis_engine.holidays.get_trading_close_holidays(year=None)[source]

Get Trading Holidays for the year

Parameters:year – optional - year integer
analysis_engine.holidays.is_holiday(date=None, date_str=None, fmt='%Y-%m-%d')[source]

Determine if the date is a holiday, if not then determine if today is a holiday. Returns True if it is a holiday and False if it is not a holiday in the US Markets.

Parameters:
  • date – optional - datetime object object for calling get_trading_close_holidays(year=date.year)
  • date_str – optional - date string formatted with fmt
  • fmt – optional - datetime.strftime formatter