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
.
Cet exercice fait partie du cours
Introduction to Portfolio Analysis in Python
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Calculate the max value
roll_max = ____.____(center=False,min_periods=1,window=____).____()
# Calculate the daily draw-down relative to the max
daily_draw_down = ____/____ - 1