Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Data Science for Finance

Problem Set 4

Exercise 1:

a)

Download the monthly CAC40 data from Yahoo finance (https://finance.yahoo.com/quote/%5EFCHI?p=^FCHI&.tsrc=fin-srch) for the period from Jan 2001 to Aug 2021. Import the data into Python. Compute the monthly stock return using the adjusted closing price.

b)

Print the lowest stock return and highest stock return during the sample period. And also print when they occur.

c)

Cumulate the stock return for each the year. To cumulate the stock return, you need to use the following formula:

Where Ry is the yearly stock return, and Ri is the monthly stock return from Jan to Dec.

d)

Plot the return against year. You can use whichever type of plot you think suitable (e.g. line chart, bar chart, etc.)

e)

What can you conclude from the graph?

Exercise 2:

a)

Download the monthly stock price data for Carrefour SA from Yahoo finance (https://finance.yahoo.com/quote/CA.PA?p=CA.PA&.tsrc=fin-srch) for the period from Jan 2019 to Aug 2021. Compute the monthly stock return for Carrefour SA. Merge with the CAC40 stock return during the same period.

b)

Repeat the same process in question a) and b) for Atos SE (https://fr.finance.yahoo.com/quote/ATO.PA?p=ATO.PA).

c)

Plot the Carrefour SA stock return and Atos SE stock return against CAC40 return using a scatter plot.

d)

What do you see from the plot?

Exercise 3:

Download the daily stock price data for Amazon.com from Yahoo finance (https://finance.yahoo.com/quote/AMZN?p=AMZN&.tsrc=fin-srch) for the period from Jan 01 2018 to Aug 31 2021. Answer the following question:

a)

Compute the daily return for Amazon.com. What is minimum, maximum, mean daily return for Amazon.com during this period?

b)

What is the annualized volatility for Amazon.com during this period?

c)

How many days see positive(negative) returns in the sample period?

d)

What is the average daily return for Amazon.com when returns are positive (negative)? What is the annualized volatility for Amazon.com when returns are positive (negative)?