A lot of company valuation speculation has come about since the COrona-VIrus-Disease-2019 (COVID-19 or COVID for short) started to impact the stock market (estimated on the 20th of February 2020, 2020-02-20). Many investors tried to estimate the impact of the outbreak on businesses and trade accordingly as fast as possible. In this haste, it is possible that they miss-priced the effect of COVID on certain stocks.
This article lays out a framework to investigate whether the Announcement of Financial Statements after COVID (id est (i.e.): after 2020-02-20) impacted the price of stocks in any specific industry sector. It will proceed simply by producing a graph of the movement in average daily close prices for each industry - averaged from the time each company produced a Post COVID Announcement (i.e.: after they first produced a Financial Statement after 2020-02-20).
From there, one may stipulate that a profitable investment strategy could consist in going long in stocks of companies (i) that did not release an announcement since COVID yet (ii) within a sector that the framework below suggests will probably increase in price following from such an announcement.
Pre-Requisites
Required Python Packages: LSEG Data Library, Numpy, Pandas, and Matplotlib.
The Python built in modules datetime and dateutil are also required.
Import libraries
First, we can use the library ' platform ' to show which version of Python we are using
This code runs on Python version 3.9.12
We use LSEG's Data Library to access financial data. We can access it via the Python library "lseg-data" that can be installed simply by using pip install.
The following are Python-built-in modules/libraries, therefore they do not have specific version numbers.
numpy is needed for datasets' statistical and mathematical manipulations
The numpy library imported in this code is version: 1.26.4
pandas will be needed to manipulate data sets
The pandas library imported in this code is version: 1.0.3
matplotlib is needed to plot graphs of all kinds
The matplotlib library imported in this code is version: 2.2.2
The cell below defines a function that adds a series of daily close prices to the dataframe named 'daily_df' and plots it.
The cell below sets up a function that gets LSEG's recorded Company Announcement Data through time for any index (or instrument)
Now we can choose only announcements post COVID.
Some instruments might have been added to the index midway during our time period of choice. They are the ones below:
['CARR.N Close Price', 'OTIS.N Close Price']
The cell below will remove them to make sure that they do not skew our statistics later on in the code.
Now we can focus on stock price movements alone.
The following 3 cells display plots to visualise our data this far.
The graph above shows the change in constituent companies' close prices since COVID.
The cell below can be run to load these variables back into the kernel
The cell below formats the date-type of our data to enable us to apply them to simple algebra.
The cell below renames the columns of our dataset.
Now: we collect daily prices only for dates after the first Post-COVID-Announcement of each instrument of interest
Now we can focus on the trend/change in those prices
And plot them
Some companies have lost and gained a great deal following from their first Post-COVID-Announcement, but most seem to have changed by less than 50 United States of america Dollars (USD).
Post COVID Announcement Price Change
The cell below simply gathers all stocks that decreased, increased or did not change in price since their first Post-COVID-Announcement in an easy to digest pandas table. Note that is they haven't had a Post-COVID-Announcement yet, they will show as unchanged.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Did not have the negative impact of COVID priced in enough | CHRW.OQ | PRGO.N | BA.N | MCD.N | HD.N | COG.N | AIZ.N | COST.OQ | AMD.OQ | REG.OQ | TRV.N | MOS.N | WDC.OQ | VTR.N | STX.OQ | VRSN.OQ | LB.N | LOW.N | BSX.N | MAS.N | BEN.N | RJF.N | CE.N | LLY.N | NWL.OQ | AVB.N | TPR.N | CINF.OQ | SEE.N | HON.N | NBL.OQ | EA.OQ | CB.N | MDLZ.OQ | BLL.N | JPM.N | CDW.OQ | COO.N | UAL.OQ | KHC.OQ | PNR.N | KSS.N | DPZ.N | HPQ.N | TGT.N | OXY.N | EXC.OQ | AZO.N | TEL.N | MXIM.OQ | AAL.OQ | VLO.N | LH.N | SHW.N | GD.N | SBAC.OQ | COP.N | GRMN.OQ | TXT.N | WELL.N | PLD.N | ROST.OQ | MRK.N | WEC.N | TMO.N | F.N | LYB.N | CERN.OQ | PEP.OQ | HP.N | ABMD.OQ | PH.N | NSC.N | BAX.N | GILD.OQ | JWN.N | NOC.N | PNW.N | BFb.N | DE.N | HSY.N | FLT.N | IT.N | ECL.N | BXP.N | GE.N | ED.N | WFC.N | FTV.N | PRU.N | DLTR.OQ | NEE.N | ILMN.OQ | XLNX.OQ | CMS.N | HPE.N | ALGN.OQ | SRE.N | REGN.OQ | DHR.N | CME.OQ | ADM.N | FANG.OQ | WRB.N | FLS.N | TROW.OQ | DRE.N | MLM.N | TWTR.N | L.N | QCOM.OQ | ANSS.OQ | ULTA.OQ | HRB.N | FISV.OQ | XRX.N | ANET.N | HLT.N | NFLX.OQ | AMGN.OQ | KIM.N | XRAY.OQ | URI.N | CNC.N | ANTM.N | K.N | LEG.N | PSA.N | NLSN.N | HOG.N | BK.N | MO.N | HST.N | BBY.N | LHX.N | KSU.N | FE.N | VZ.N | NEM.N | GIS.N | CMCSA.OQ | PFE.N | EIX.N | UPS.N | IP.N | MMM.N | INTU.OQ | OKE.N | ADP.OQ | EQIX.OQ | MTD.N | PEG.N | CTSH.OQ | NCLH.N | HIG.N | UHS.N | INCY.OQ | UNM.N | LRCX.OQ | PPG.N | LKQ.OQ | TJX.N | VMC.N | EW.N | ALL.N | MHK.N | CAT.N | PG.N | ZTS.N | AFL.N | CPB.N | MSI.N | ITW.N | GPS.N | ALK.N | PGR.N | DISCA.OQ | KMB.N | EL.N | SPGI.N | ADSK.OQ | WHR.N | AKAM.OQ | LUV.N | AMZN.OQ | FTI.N | BRKb.N | KR.N | BKNG.OQ | MA.N | SWK.N | DISCK.OQ | OMC.N | GLW.N | CRM.N | SBUX.OQ | TAP.N | ABT.N | JNPR.N | IRM.N | PEAK.N | FIS.N | ROK.N | HBI.N | DOW.N | PPL.N | ETN.N | CI.N | XYL.N | HAS.OQ | SO.N | VNO.N | CTL.N | DLR.N | AVY.N | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None |
| Had the effects of COVID priced in (or didn't have time to react to new company announcements) | AMCR.N | SPG.N | COTY.N | UAA.N | MYL.OQ | CAH.N | ZBH.N | AEE.N | IFF.N | MAR.OQ | ETR.N | UA.N | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None | None |
| Had a price that overcompensated the negative impact of COVID | AJG.N | CNP.N | WM.N | FOX.OQ | WY.N | HBAN.OQ | QRVO.OQ | LVS.N | AIG.N | MCO.N | DIS.N | PAYX.OQ | DHI.N | BWA.N | IVZ.N | ZBRA.OQ | SYK.N | NVR.N | SYY.N | FCX.N | EVRG.N | EXPD.OQ | PAYC.N | AIV.N | CL.N | UNH.N | ARE.N | TIF.N | ISRG.OQ | PVH.N | ADS.N | CBRE.N | WMB.N | TMUS.OQ | TXN.OQ | PFG.OQ | KEYS.N | INFO.N | RMD.N | LNT.OQ | NOV.N | CMG.N | PCAR.OQ | CHTR.OQ | PWR.N | CCL.N | PM.N | SNA.N | ESS.N | JBHT.OQ | LW.N | IR.N | WAB.N | FBHS.N | NOW.N | BR.N | EMN.N | FRT.N | DVN.N | MKC.N | IEX.N | DRI.N | MAA.N | JNJ.N | ABC.N | ORCL.N | AMP.N | ALXN.OQ | T.N | NDAQ.OQ | FFIV.OQ | SLG.N | LEN.N | CDNS.OQ | MSCI.N | IBM.N | VRTX.OQ | DXCM.OQ | AOS.N | BLK.N | HII.N | CVS.N | MSFT.OQ | HUM.N | CMA.N | GL.N | SLB.N | AWK.N | PKG.N | MMC.N | BKR.N | ALLE.N | CTVA.N | CF.N | AEP.N | FMC.N | KLAC.OQ | AME.N | NUE.N | WU.N | D.N | SJM.N | EMR.N | DVA.N | RHI.N | BDX.N | MGM.N | EFX.N | USB.N | HCA.N | NWSA.OQ | AAPL.OQ | MRO.N | APD.N | VAR.N | AXP.N | CLX.N | DOV.N | FDX.N | JKHY.OQ | O.N | PKI.N | IPG.N | PHM.N | PBCT.OQ | KO.N | WLTW.OQ | ES.N | CTAS.OQ | GPN.N | RSG.N | RF.N | PXD.N | DG.N | EQR.N | TDG.N | NKE.N | AES.N | GWW.N | GOOGL.OQ | GM.N | CCI.N | COF.N | ROP.N | CXO.N | C.N | ODFL.OQ | GS.N | MET.N | WYNN.OQ | FAST.OQ | LDOS.N | ORLY.OQ | CSX.OQ | CFG.N | NI.N | DD.N | HOLX.OQ | STT.N | JCI.N | PNC.N | ROL.N | KEY.N | NWS.OQ | MU.OQ | UNP.N | BAC.N | KMX.N | VIAC.OQ | APA.N | CHD.N | EBAY.OQ | BIIB.OQ | ALB.N | UDR.N | DGX.N | CBOE.Z | ETFC.OQ | VRSK.OQ | AMT.N | PYPL.OQ | CAG.N | TFX.N | SYF.N | WAT.N | IDXX.OQ | HES.N | EOG.N | MNST.OQ | FRC.N | BMY.N | APH.N | GPC.N | MCHP.OQ | FITB.OQ | XEL.OQ | HSIC.OQ | DFS.N | APTV.N | MPC.N | ZION.OQ | ICE.N | SWKS.OQ | EXR.N | IPGP.OQ | ADBE.OQ | WRK.N | FOXA.OQ | TSN.N | TSCO.OQ | AON.N | MS.N | GOOG.OQ | STZ.N | ABBV.N | XOM.N | HRL.N | INTC.OQ | WBA.OQ | ATO.N | HAL.N | TFC.N | ATVI.OQ | V.N | LYV.N | RE.N | FTNT.OQ | DAL.N | NTRS.OQ | CVX.N | LNC.N | ACN.N | CTXS.OQ | DISH.OQ | NRG.N | MKTX.OQ | LMT.N | PSX.N | FLIR.OQ | SCHW.N | J.N | SIVB.OQ |
| Average of Close Prices Post COVID Announcement | |
|---|---|
| Energy | 0.510261 |
| Basic Materials | -0.113836 |
| Industrials | 0.557313 |
| Consumer Cyclicals | 1.606089 |
| Consumer Non-Cyclicals | 0.763417 |
| Financials | 1.065371 |
| Healthcare | 0.070465 |
| Technology | 5.372840 |
| Telecommunication Services | 1.167946 |
| Utilities | -0.540518 |
The 'ESector_average' table above shows the Close Prices Post COVID-Announcement for each company averaged per sector
The cells below now allow us to visualise this trend in a graph on an industry sector basis
This cell below in particular allows us to collect and save our data before continuing so that we don't have to ask for data from the Data Platform again were we to manipulate the same content later (just in case)
Conclusion
Using S&P 500 (i.e.: SPX) data, this last graph can provide a wholesome picture of industries in the United States of America (USA). We can see a great negative change in instruments’ daily close prices for stocks in the Consumer Cyclical, Utilities, Healthcare and Industrial markets. This is actually surprising because they are the industries that were suggested to be most hindered by COVID in the media before their financial statement announcements; investors thus ought to have priced the negative effects of the Disease on these market sectors appropriately.
The graph suggests that it may be profitable to short companies within these sectors just before they are due to release their first post-COVID Financial Statements - but naturally does not account for future changes, trade costs or other such variants external to this investigation. Companies in the Financial sector seem to have performed adequately. Reasons for movements in this sector can be complex and numerous due to their exposure to all other sectors. Tech companies seem to have had the impact of COVID priced in prior to the release of their financial statements. One may postulate the impact of COVID on their share price was actually positive as people rush to online infrastructures they support during confinement. Companies dealing with Basic Material have performed relatively well. This may be an indication that investors are losing confidence in all but sectors that offer physical goods in supply chains (rather than in consumer goods) - a retreat to fundamentals in a time of uncertainty.
BUT one must use both the ESector_average table and the last graph before coming to any conclusion. The ESector_average - though simple - can provide more depth to our analysis. Take the Healthcare sector for example: One may assume – based on the last graph alone – that this sector is performing badly when revealing information via Announcements; but the ESector_average shows a positive ‘Average of Close Prices Post COVID Announcement’. This is because only very few companies within the Healthcare sector published Announcements before May 2020, and the only ones that did performed badly, skewing the data negatively on the graph.
References
You can find more detail regarding the Data Library and related technologies for this notebook from the following resources:
- LSEG Data Library for Python Page on the LSEG Developer Community web site.
- The Data Library for Python - Quick Reference Guide (Access layer)
For any question related to this example or the Data Library, please use the Developers Community Q&A Forum.