Skip to content
Automate Bard

Automate Bard

Supercharge Your Productivity with AI

  • Stock Data
  • AI Image Up-Scaler
  • Home
  • 2023
  • August
  • 1
  • Trading Days In 2022

Trading Days In 2022

Posted on August 1, 2023October 30, 2023 By user No Comments on Trading Days In 2022
stock data

There were 251 trading days in the year 2022 (including the day after Thanksgiving, November 26th, when the market closed at 1pm)

Below is a break down of the number of days the market was open for each month, then the python code used to generate this data, and finally a list of dates the market was open.

Days Market Was Closed in 2022

Data is found here: https://www.nasdaq.com/market-activity/2022-stock-market-holiday-calendar

List of dates market was closed in 2022: 
Martin Luther King, Jr. Day	    January 17, 2022	Closed
Presidents Day	                    February 21, 2022	Closed
Good Friday	                    April 15, 2022	Closed
Memorial Day	                    May 30, 2022	Closed
Juneteenth Holiday	            June 20, 2022	Closed
Independence Day	            July 4, 2022	Closed
Labor Day	                    September 5, 2022	Closed
Thanksgiving Day	            November 24, 2022	Closed
Early Close	                    November 25, 2022	1:00 p.m.
Christmas Holiday	            December 26, 2022	Closed

Days Market Was Open Each Month

January: 20
February: 19
March: 23
April: 20
May: 21
June: 21
July: 20
August: 23
September: 21
October: 21
November: 21 (20 if 1pm close considered)
December: 21

Python Code

'''
Code Written By AutomateBard.com

Generates list of dates American markets were open for trading.

List of dates market was closed in 2022: https://www.nasdaq.com/market-activity/2022-stock-market-holiday-calendar
Martin Luther King, Jr. Day	    January 17, 2022	Closed
Presidents Day	                    February 21, 2022	Closed
Good Friday	                    April 15, 2022	Closed
Memorial Day	                    May 30, 2022	Closed
Juneteenth Holiday	            June 20, 2022	Closed
Independence Day	            July 4, 2022	Closed
Labor Day	                    September 5, 2022	Closed
Thanksgiving Day	            November 24, 2022	Closed
Early Close	                    November 25, 2022	1:00 p.m.
Christmas Holiday	            December 26, 2022	Closed
'''

import pandas as pd

year = 2022
market_closed = [
    '2022-01-17',
    '2022-02-21',
    '2022-04-15',
    '2022-05-30',
    '2022-06-20',
    '2022-07-04',
    '2022-09-05',
    '2022-11-24',
    #'2022-11-25', # 1pm close
    '2022-12-26'
]


def generate_all_dates(year):
    start = pd.to_datetime(f'01-01-{year}')
    end = pd.to_datetime(f'12-31-{year}')
    df = pd.Series(pd.date_range(start, end))
    return df


def filter_weekdays(series):
    new_series = series[series.dt.dayofweek < 5]
    return new_series


def filter_market_closed_days(series, list_market_closed_dates):
    series = series[series.isin(list_market_closed_dates) == False]
    return series


#
if __name__ == '__main__':

    dates = (generate_all_dates(year))
    #print(dates)
    weekdays = filter_weekdays(dates)
    #print(weekdays)
    market_open = filter_market_closed_days(weekdays, market_closed)
    print(market_open)
    print(f"Total days open: {len(market_open)}")

List Of Dates Market Was Open

2022-01-03
2022-01-04
2022-01-05
2022-01-06
2022-01-07
2022-01-10
2022-01-11
2022-01-12
2022-01-13
2022-01-14
2022-01-18
2022-01-19
2022-01-20
2022-01-21
2022-01-24
2022-01-25
2022-01-26
2022-01-27
2022-01-28
2022-01-31
2022-02-01
2022-02-02
2022-02-03
2022-02-04
2022-02-07
2022-02-08
2022-02-09
2022-02-10
2022-02-11
2022-02-14
2022-02-15
2022-02-16
2022-02-17
2022-02-18
2022-02-22
2022-02-23
2022-02-24
2022-02-25
2022-02-28
2022-03-01
2022-03-02
2022-03-03
2022-03-04
2022-03-07
2022-03-08
2022-03-09
2022-03-10
2022-03-11
2022-03-14
2022-03-15
2022-03-16
2022-03-17
2022-03-18
2022-03-21
2022-03-22
2022-03-23
2022-03-24
2022-03-25
2022-03-28
2022-03-29
2022-03-30
2022-03-31
2022-04-01
2022-04-04
2022-04-05
2022-04-06
2022-04-07
2022-04-08
2022-04-11
2022-04-12
2022-04-13
2022-04-14
2022-04-18
2022-04-19
2022-04-20
2022-04-21
2022-04-22
2022-04-25
2022-04-26
2022-04-27
2022-04-28
2022-04-29
2022-05-02
2022-05-03
2022-05-04
2022-05-05
2022-05-06
2022-05-09
2022-05-10
2022-05-11
2022-05-12
2022-05-13
2022-05-16
2022-05-17
2022-05-18
2022-05-19
2022-05-20
2022-05-23
2022-05-24
2022-05-25
2022-05-26
2022-05-27
2022-05-31
2022-06-01
2022-06-02
2022-06-03
2022-06-06
2022-06-07
2022-06-08
2022-06-09
2022-06-10
2022-06-13
2022-06-14
2022-06-15
2022-06-16
2022-06-17
2022-06-21
2022-06-22
2022-06-23
2022-06-24
2022-06-27
2022-06-28
2022-06-29
2022-06-30
2022-07-01
2022-07-05
2022-07-06
2022-07-07
2022-07-08
2022-07-11
2022-07-12
2022-07-13
2022-07-14
2022-07-15
2022-07-18
2022-07-19
2022-07-20
2022-07-21
2022-07-22
2022-07-25
2022-07-26
2022-07-27
2022-07-28
2022-07-29
2022-08-01
2022-08-02
2022-08-03
2022-08-04
2022-08-05
2022-08-08
2022-08-09
2022-08-10
2022-08-11
2022-08-12
2022-08-15
2022-08-16
2022-08-17
2022-08-18
2022-08-19
2022-08-22
2022-08-23
2022-08-24
2022-08-25
2022-08-26
2022-08-29
2022-08-30
2022-08-31
2022-09-01
2022-09-02
2022-09-06
2022-09-07
2022-09-08
2022-09-09
2022-09-12
2022-09-13
2022-09-14
2022-09-15
2022-09-16
2022-09-19
2022-09-20
2022-09-21
2022-09-22
2022-09-23
2022-09-26
2022-09-27
2022-09-28
2022-09-29
2022-09-30
2022-10-03
2022-10-04
2022-10-05
2022-10-06
2022-10-07
2022-10-10
2022-10-11
2022-10-12
2022-10-13
2022-10-14
2022-10-17
2022-10-18
2022-10-19
2022-10-20
2022-10-21
2022-10-24
2022-10-25
2022-10-26
2022-10-27
2022-10-28
2022-10-31
2022-11-01
2022-11-02
2022-11-03
2022-11-04
2022-11-07
2022-11-08
2022-11-09
2022-11-10
2022-11-11
2022-11-14
2022-11-15
2022-11-16
2022-11-17
2022-11-18
2022-11-21
2022-11-22
2022-11-23
2022-11-25
2022-11-28
2022-11-29
2022-11-30
2022-12-01
2022-12-02
2022-12-05
2022-12-06
2022-12-07
2022-12-08
2022-12-09
2022-12-12
2022-12-13
2022-12-14
2022-12-15
2022-12-16
2022-12-19
2022-12-20
2022-12-21
2022-12-22
2022-12-23
2022-12-27
2022-12-28
2022-12-29
2022-12-30

Stay in the loop! Sign up for new post alerts from AutomateBard.com

* indicates required
/* real people should not fill this in and expect good things - do not remove this or risk form bot signups */

Related

Post navigation

❮ Previous Post: How to Set the Temperature for AI to Generate Creative and Informative Text
Next Post: Tesla (TSLA) Level 1 Stock Data – Tick Data – SubSecond Resolution ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • May 2023
  • April 2023

Recent Posts

  • How To Program A Conversational AI (ChatBot) Using Mistral-7B-Instruct Tutorial
  • How To Get Started With Mistral-7B-Instruct-v0.2 Tutorial
  • How To Get Started With Stable Diffusion Video Using Python – Tutorial
  • How To Get Started With Mistral-7B Tutorial
  • Can Bard Read PDFs, URLs and Images Containing Text with Gemini?

Categories

  • AI News
  • Articles
  • Automation
  • bard prompts
  • Chat-GPT
  • data gathering
  • DeepMind
  • Food
  • Gemini
  • HuggingFace
  • midjourney
  • Mistral
  • OpenAI
  • optimization
  • productivity
  • python
  • stable diffusion
  • stock data
  • testing bard
  • Uncategorized
  • Using AI Effectively
  • using bard
  • Stock Data
  • AI Image Up-Scaler

Copyright © 2025 Automate Bard.

Theme: Oceanly by ScriptsTown