Gallery
Due the 4th of November.
Web Scraping
Install required scraping libraries (can take 5 minutes). Scrape for S&P Constituents and Grab Wikipedia Page. We want to use a pre-built scraper to grab the appropriate data on the MSCI website. To learn more about the scraper you can go and visit this python repository.
Notice the scraper is broken! But I provided some code in the notebook to download the data that I scraped in the past. You don’t have to fix the scraper, that would be too hard.
Trading Strategy
After you have scraped the data, you can create a small trading strategy to see if the ESG data is helpful:
•
You can create a strategy that assumes that you have had access to this data since 2018.
•
That means that you can backtest the strategy from 2018 to 2021.
•
An example of the most obvious strategies is to go long and short a few companies and to measure the performance over time (long short strategy).
•
You can show the performance over time using a range of statistics like the sharpe ratio, but perhaps the easiest is to plot the cummulative returns.
•
For example the start of a very easy strategy could be:
There are many places in the internet where you can get pricing data, in fact your first homework you obtained pricing data, have a look at yfinance on github if you are still unsure.
F. Trading Strategy (HW3)