ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Financial Trading in Python

Ver curso

Instrucciones del ejercicio

  • 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.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# 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)
Editar y ejecutar código