Exercise

Maximum draw-down portfolio

In this exercise, you'll learn how to calculate the maximum draw-down of the S&P500 (also known as "peak to trough performance drop"). Maximum draw-down is an incredibly insightful risk measure. It tells you what has been the worst performance of the S&P500 in the past years.

It is the reason why many investors shy away from crypto-currencies; nobody likes to lose a large percentage of their investment (e.g., 70%) in a short period.

In order to calculate the maximum draw-down of the S&P500, the daily S&P500 prices have been made available to you in a DataFrame called df.

Instructions 1/3

undefined XP
    1
    2
    3
  • Taking a window of 252 trading days, find the rolling maximum value of the S&P500 prices in df and calculate daily draw-downs by dividing the prices in df by roll_max.