【Data Analysis】Is There an Olympic Market Trends? Analyzing the market trends of Taiwanese stocks and industrial stocks during the Olympic Games Using TEJ API

TEJ 台灣經濟新報
TEJ-API Financial Data Analysis
9 min readMar 29, 2024
Olympic Market Trends
Photo by Luca Dugaro on Unsplash

Highlight

  • Article Difficulty:★☆☆☆☆
  • Analyze the market’s stock price, Olympic performance, and related industries in the past three Olympic Games.

Preface

Compared to the 2021 Tokyo Olympics held during the pandemic, the 2024 Paris Olympics are bound to be superb following the lifting of pandemic restrictions. By analyzing the stock market performance of the major indices and relevant industries during the past three Olympic Games, we can uncover the dynamic changes in the stock market during these major sporting events. This article will use the TEJ API to explore Olympic market trends and better understand the stock market performance during the Olympic Games.

Editing Environment and Module Requirements

This article uses the Windows 11 OS and VScode as the editor.

Database Usage

TAIEX(Y9999) Olympic Market Trends Analysis

Data Import & Set up the function

import tejapi
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates

tejapi.ApiConfig.api_key = "Your Key"
tejapi.ApiConfig.api_base = "https://api.tej.com.tw"
tejapi.ApiConfig.ignoretz = True

Set the TAIEX (Y9999) adjusted closing price function and the start and end dates as variables.

def get_TAIEX(gte , lte):
data = tejapi.get('TWN/APRCD1',
coid = 'Y9999',
mdate = {'gte':gte, 'lte':lte},
opts = {'columns':['coid', 'mdate', 'close_adj', 'roi']},
paginate = True,
)
return data

Record the dates and the years of the past three Olympic Games and convert them into DataFrame to facilitate subsequent analysis.

Olympic_opening =  [pd.Timestamp('2012-07-27', tz = 'UTC'),
pd.Timestamp('2016-08-05', tz = 'UTC'),
pd.Timestamp('2021-07-23', tz = 'UTC')
]
Olympic_ending = [pd.Timestamp('2012-08-12', tz = 'UTC'),
pd.Timestamp('2016-08-21', tz = 'UTC'),
pd.Timestamp('2021-08-08', tz = 'UTC')
]
Olympic Market Trends

Data Visualization Analysis

Substitute the Olympic Games start and end dates into theget_TAIEX function, set the time interval to two weeks before the opening and after the closing, and mark the start and end dates on the graph. The visual chart sets the two axes as daily closing price and daily return rate (%).

Olympic Market Trends
Line chart of TAIEX (Y9999) stock price and rate of return (%) for the past three Olympic Games

From the chart, it can be observed that the performance of the Olympics was better in 2012 and 2016, especially in the 2–3 working days leading up to the opening day, where stock prices showed an upward trend. This upward trend is more pronounced when observing the percentage (%) returns line. In 2021, the Olympic performance was comparatively weaker. However, there was still an upward trend in the 2–3 working days leading up to the opening day, albeit with less strength. It is worth noting that 2021 may have experienced greater market volatility due to the outbreak of the COVID-19 pandemic, making it more challenging to discern its impact on the stock market.

Analysis of the Olympic Market Trends of Industrial Stocks

Capture Olympics-related industries

The hosting of the Olympics drives an increase in demand for related industries, making it a pivotal year for sportswear brands to showcase their capabilities, with performance inevitably growing in the Olympic years. Major international brands include Nike, GAP, Lululemon, Under Armour, Adidas, Fast Retailing, etc. This article outlines six major Olympic-related industries, including the apparel, footwear, and exercise equipment industries influenced by sports trends, the panel industry benefiting from increased TV demand, and the aviation and tourism industries influenced by tourism trends and international events. Specific companies within each industry are selected as examples.

The following are Olympic-related industries selected based on TEJ Sub Industry Name

  • LCD Panel — 2409(AUO) , 3481(INX) , 6116(Hannstar)
    2409(AUO), 3481(INX), and 6116(Hannstar) are the top three panel companies in the Taiwan stock market. The panel industry, driven by the advancement of broadcasting, will have the opportunity to benefit from the theme of this year’s large-scale sports events.
  • POY, Ready-made clothes — 1402(Makalot) , 1476(FENC) , 1477(ECLAT)
    1402(Makalot), 1476(FENC, and 1477(ECLAT)
    are textile manufacturers for many international sports brands, such as NIKE, Adidas, Lululemon, Under Armor, GAP, UNIQLO, H&M, A&F, etc.
  • Shoes & Suitcases — 9802(KY-Fulgent Sun) , 9904(FT) , 9910(PCC)
    9802(KY-Fulgent Sun), 9904(FT), 9910(PCC)
    are shoe manufacturers for many international sports brands, such as Nike, Adidas, Asics, New Balance, Timberland, Under Armor, etc.
  • Exercise Equipment, Bicycle — 1515(Rexon) , 1736(JHT) , 9921(Giant)
    The Olympic Games have driven the sales of sports and fitness equipment products, including treadmills, bicycles, etc. 1515(Rexon), 1736(JHT), 9921(Giant) are domestic fitness equipment and bicycle leaders. They will have the opportunity to bring tremendous business opportunities due to the lifting of lockdown and large-scale sports events.
  • Travel Agency — 2731(Liontravel) , 5706(PHX Tour)
    The tourism industry, driven by watching the games 2731(Liontravel) and 5706(PHX Tour), can benefit from the 2024 Paris Olympics.
  • Transport by Air — 2610(CAL) , 2618(EVAAIR)
    As the 2024 Paris Olympics is an international event and the first Olympics after the pandemic is lifted, 2610(CAL) and 2618(EVAAIR) in the air transport industry have the opportunity to benefit.
industry_dict = {
'LCD_panel': ['2409', '3481', '6116'],
'clothes': ['1402', '1476', '1477'],
'shoes': ['9802', '9904', '9910'],
'fitness_bike': ['1515', '1736', '9921'],
'travel': ['2731', '5706'],
'aviation': ['2610', '2618']
}

Set up the function

Set the capture corporate data function and the security code as a variable, and enter the security code in list form.

def get_data_industry(*coid):  # *coid can input list-type variables
data_industry = tejapi.get('TWN/AIND',
coid = coid,
opts = {'columns':['coid', 'fnamee', 'tejinm3_e']},
paginate = True)
data_industry = data_industry.rename(columns={"fnamee":"Company", "tejinm3_e": "Industry"}).reset_index().drop(columns=['None'])
return data_industry

Set the capture the stock price function, set the start and end date and security code as variables, and enter the security code in the list type.

def get_stock_price(gte , lte , *coid):
data = tejapi.get('TWN/APRCD1',
coid = coid,
mdate = {'gte':gte, 'lte':lte},
opts = {'columns':['coid', 'mdate', 'close_adj']},
paginate = True,
)
return data

Data Visualization Analysis

Substitute the start and end dates of the Olympic Games and the security codes selected in this article for the get_stock_price function, set the time interval to two weeks before the opening and after the closing of the Olympic Games, and mark the start and end dates of the Olympic Games on the graph.

  • LCD Panel Industry
Olympic Market Trends
LCD panel industry for the past three Olympic Games — 2409, 3481, 6116 stock market charts

From the chart above, we can see that both 2016 and 2021 showed an upward trend 2 to 3 working days before the opening of the Olympic Games. Although there was no upward trend in 2012, it slowed down the original decline. There is no particular trend after the Olympic Games; some rise and some fall. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the stock market of the panel industry. Still, seeing the effect on the stock market after the Olympics ends will be difficult.

  • POY, Ready-made clothes industries
Olympic Market Trends
POY, Ready-made clothes industries for the past three Olympic Games — 1402, 1476, 1477 stock market charts

The chart above shows an upward trend in the 2 to 3 working days before the opening of these three Olympic Games. There is no particular trend after the Olympics. Some prices rise, some fall, and the majority fall. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the stock market of the garment and textile industry. At the same time, it won’t be easy to see the effect on the stock market after the Olympic Games ends.

  • Shoes & Suitcases industry
Olympic Market Trends
Shoes & Suitcases industry of the past three Olympic Games — 9802, 9904, 9910 stock market charts

From the picture above (9802 was only listed in October 2012, so the upper left image is empty), it can be seen that in 2012 and 2016, there was an upward trend 2 to 3 working days before the opening of the Olympic Games. Although there was no noticeable increase in 2021, the upward trend slowed down the original decline. There is no particular trend after the Olympic Games; some rise and some fall. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the shoemaking industry stock market. Still, it won’t be easy to see the effect on the stock market after the Olympics ends.

  • Exercise Equipment, Bicycle industries
Olympic Market Trends
Exercise Equipment, Bicycle industries for the past three Olympic Games — 1515, 1736, 9921 stock market charts

The chart above shows an upward trend in the 2 to 3 working days before the opening of the three Olympic Games, which was the most significant in 2012. There is no particular trend after the Olympic Games. Some prices rise, and some fall, but most prices rise. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the stock market of the sports equipment industry. Still, seeing the effect on the stock market after the Olympics ends will be difficult.

  • Travel Agency industry
Olympic Market Trends
Travel Agency industry for the past three Olympic Games — 2731, 5706 stock market chart

The above figure shows an upward trend in the 2 to 3 working days before these three Olympic Games opened. There is no particular trend after the Olympic Games and most fall. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the tourism industry’s stock market. At the same time, it won’t be easy to see the effect on the stock market after the Olympics ends.

  • Transport by Air industry
Olympic Market Trends
Transport by Air industry for the past three Olympic Games — 2610, 2618 stock market charts

It can be seen from the above figure that there is an upward trend in the 2 to 3 working days before the opening of these three Olympic Games. There is no particular trend after the Olympics. For example, prices fell after the Olympics closed in 2021, while prices rose in 2012 and 2016. From this, we can speculate that the opening of the Olympic Games will have a short-term positive impact on the aviation industry’s stock market. After large-scale international competitions, it won’t be easy to see the effect on the stock market after the Olympics.

Conclusion

From observing the TAIEX and individual stocks in related industries during the past three Olympic Games, we noticed a general uptrend in stock prices in the 2–3 working days leading up to the opening day. This trend was particularly significant in 2012 and 2016, while 2021 may have been affected by the pandemic. However, after the Olympics concluded, the stock market performance became more unstable, with some stocks rising and others falling. Overall, this suggests that the opening of the Olympics has a specific short-term positive impact on the TAIEX and the stock market of the industries mentioned in this article. However, the post-Olympic impact is more challenging to predict. In the long run, the Olympics are just a singular event in the holding period, so it’s best to base investment decisions on factors such as company fundamentals, competitive advantages, and other considerations.

This implementation analyzes Olympic Market Trends using the TEJ API. Using the data provided by TEJ API, we can implement various types of analysis as far as we can imagine. This approach saves time and effort and furnishes investors with a more diversified evaluation method. Explore more related solutions in TEJ E-Shop. Construct your trading strategy with a high-quality database.

Reminder: The strategy is only for reference and does not represent recommendations or advice on financial products and investments.

GitHub Source Code

Extended Reading

Related Links

--

--

TEJ 台灣經濟新報
TEJ-API Financial Data Analysis

TEJ 為台灣本土第一大財經資訊公司,成立於 1990 年,提供金融市場基本分析所需資訊,以及信用風險、法遵科技、資產評價、量化分析及 ESG 等解決方案及顧問服務。鑒於財務金融領域日趨多元與複雜,TEJ 結合實務與學術界的精英人才,致力於開發機器學習、人工智慧 AI 及自然語言處理 NLP 等新技術,持續提供創新服務