Weekly Dose of Data Analyst#12— What is the best day to buy stocks in ASX ?

Common Man
4 min readMay 4, 2021
Photo by Jason Briscoe on Unsplash

DISCLAIMER: THIS POST IS JUST AN SIMPLE ANALYSIS OUT OF PERSONAL INTERESTS. IT IS NOT ANY FINICIAL ADVICE. INVESTMENT IS RISKY!!!

Problem:

Stock (a.k.a “Stonk”) has been a pretty hot topic recently. In stock trading , there is a strategy called “Sell in May and Go Away” which means people should sell their stocks in May since this is the month where most of stock value goes down. This strategy seems to be supported by some historical data.

How about day of the week then ? Is there a better day of the week to buy stocks in ASX ?

Similar Studies:

Similar study has been done by Tom Bulkowski on his website where he analyzes percentages of stocks going up for each day from Dow, Nasdaq and S&P500 during 2000 to 2010 period.

TLDR:

Friday is the best day to buy stock in ASX based on data from 1997–2019, as 31% of all stocks’ closed price are higher than their opening price on Friday.

However, as can be observed from the bar chart below, the difference between Friday and other days of the week are minimum.

Further Analysis:

Compare to the results from US stocks, the percentages of the stock closed higher each day is much lower. This is possibly due to that ASX is a fairly small market compare to Dows and Nasdaq which means not many investors will buy stocks in ASX. Therefore, many stocks will not move during the same day. This further dilute the percentages of the stock goes up.

Preparation Process:

  1. Following data is required:
  • All ASX stocks’ open and closed value for each day from 1997–2019

All above information can be obtained from ASX Historical Data website.

2. Data Acquisition & Extraction:

All Data is downloadable as csv files on the website.

They can be loaded in Jupyter notebook using Pandas packages from Python.

3. Data Examination:

As mentioned at the main page of ASX historical data website, this data does not consider the stock split and dividend. Since only daily results will be compared, this will not affect our results.

At the end of Jupyter notebook, we can see overall 5811 days of stock trading data have been analyzed. Each year, the number of stock trading days should be the same as the number of working days. Using Google, it is easy to find that each year in Australia there are 254 working days. From 1997 to 2019, there are in total 23 years. Therefore, there should be approximately 254 x 23 = 5842 days of data. This value is close to 5811 days which have been analyzed.

4. Data Transformation:

Each line in the csv file represents one stock’s open and closed value of that day.

First function is written to record the total number of stocks in a csv file and the number of stocks which closed value is higher than open value in the same csv files. These two variables will stored as variable “total_number_stock” and “k” respectively.

Second function is written to find all csv files under specified directory and use first function to analyse all of them and save all results in a list. Date information can be extracted from the csv file name.

The list containing all information then will be converted to one dataframe.

Function dropna() will be used to drop out all missing values from Saturday and Sunday value in the dataframe since there ASX does not open during weekends.

Then to calculate the percentages of stock goes up by the end of the day, we will use the sum of “k” divide the sum of “total_number_stock”.

Finally, the bar chart of percentages vs the day of the week can be plotted as shown in TLDR section.

All data preparation process mentioned above is executed and commented in the Jupyter notebook. Please click the link here for the Jupyter notebook on github.

To run this Jupyter notebook, Please make sure you unzip all data under the same directory of the notebook python file.

If you like my works, please leave a comment below.

--

--

Common Man

An Individual who is passionate about data analyzing and AI