Aan de slagGa gratis aan de slag

Calculate and review the Calmar ratio

Continue with the same strategy. From the previous exercise, you know that the average drawdown is approximately 11%, and that the average period is 22 days. Now you would like to get a better understanding of the risk-return profile of it. You plan to review the CAGR, max drawdown, then use them to calculate the Calmar ratio and assess the result.

The resInfo DataFrame that contains all backtest statistics has been provided for you.

Deze oefening maakt deel uit van de cursus

Financial Trading in Python

Cursus bekijken

Oefeninstructies

  • Get the compound annual growth rate (CAGR) from resInfo.
  • Get the max drawdown from resInfo.
  • Calculate the Calmar ratio using cagr and max_drawdown.
  • Obtain the Calmar ratio directly from resInfo and review it.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Get the CAGR
cagr = ____
print('Compound annual growth rate: %.4f'% cagr)

# Get the max drawdown
max_drawdown = ____
print('Maximum drawdown: %.2f'% max_drawdown)

# Calculate Calmar ratio manually
calmar_calc = ____ / ____ * (-1)
print('Calmar Ratio calculated: %.2f'% calmar_calc)

# Get the Calmar ratio
calmar = ____
print('Calmar Ratio: %.2f'% calmar)
Code bewerken en uitvoeren