ドローダウン

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: CALifornia Managed Accounts Report

 

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

  • カルマー比が高いほど、リスク調整後の成績は良好。
  • 一般にカルマー比が3超は優秀とされます。
Pythonで学ぶ金融トレーディング

カルマー比を手計算する

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で学ぶ金融トレーディング

バックテスト統計からカルマー比を取得

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