Get startedGet started for free

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.

This exercise is part of the course

Introduction to Portfolio Analysis in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample 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
Edit and Run Code