드로우다운

Python으로 배우는 금융 트레이딩

Chelsea Yang

Data Science Instructor

드로우다운이란?

드로우다운은 특정 기간 동안 자산이나 계좌의 고점 대비 저점 하락입니다.

드로우다운 차트

Python으로 배우는 금융 트레이딩

최대 드로우다운

$\text{Max Drawdown} = (V_p - V_l)/ V_l $

$V_p$: 최대 하락 전 고점 값

$V_l$: 새 고점 전 최저값

최대 드로우다운 예시

최대 드로우다운

= (지점 A 값 - 지점 D 값)/지점 A 값 = (1700 - 800)/1700 = 53%

Python으로 배우는 금융 트레이딩

백테스트 통계에서 드로우다운 확인

resInfo = bt_result.stats

# Get the max drawdown max_drawdown = resInfo.loc['max_drawdown'] print('Maximum drawdown: %.2f'% max_drawdown)
# Get the average drawdown avg_drawdown = resInfo.loc['avg_drawdown'] print('Average drawdown: %.2f'% avg_drawdown)
# Get the average drawdown days avg_drawdown_days = resInfo.loc['avg_drawdown_days'] print('Average drawdown days: %.0f'% avg_drawdown_days)
Maximum drawdown: -0.59
Average drawdown: -0.11
Average drawdown days: 22
Python으로 배우는 금융 트레이딩

Calmar 비율

CALMAR: CALifornia Managed Accounts Report

 

$ Calmar = CAGR / \text{Max Drawdown} $

  • Calmar 비율이 높을수록 위험 조정 후 성과가 더 좋습니다.
  • 일반적으로 Calmar 비율 3 초과는 매우 우수합니다.
Python으로 배우는 금융 트레이딩

Calmar 비율 수동 계산

resInfo = bt_result.stats
# Get the CAGR
cagr = resInfo.loc['cagr']
# Get the max drawdown
max_drawdown = resInfo.loc['max_drawdown']

# Calculate Calmar ratio mannually calmar_calc = cagr / max_drawdown * (-1) print('Calmar Ratio calculated: %.2f'% calmar_calc)
Calmar Ratio calculated: 4.14
Python으로 배우는 금융 트레이딩

백테스트 통계에서 Calmar 비율 확인

resInfo = bt_result.stats

# Get the Calmar ratio
calmar = resInfo.loc['calmar']
print('Calmar Ratio: %.2f'% calmar)
Calmar Ratio: 4.14
Python으로 배우는 금융 트레이딩

연습해 봅시다!

Python으로 배우는 금융 트레이딩

Preparing Video For Download...