LoginSignup
2
1

More than 3 years have passed since last update.

Calmar Ratio(カルマーレシオ)とは

Last updated at Posted at 2020-07-04

1 目的

Calmar Ratio(カルマーレシオ)の意味と計算方法を説明します。

2 内容

2-1 Returnの計算方法

ある銘柄の開始日から当日までのReturnはこちらの定義に従います

2-2 Maxdrowdownの計算方法

Returnが最大になった以降で、どの程度の割合でReturnが下落し底を打つのかを評価する式のことです。

具体的に開始日からn営業日の期間において、Returnの最大値を$R_{max}^{(n)}$とする。

R_{max}^{(n)}=max\left\{R_{i} | 0<i≦n \right\}

ここで、Maxdrowdown $MDD_{max}^{(n)}$は下記式で定義する。

MDD_{max}^{(n)}=max\left\{\frac{R_{max}^{(n)}}{R_{i}} | 0<i≦n \right\}

90.JPG

2-3 Calmar Ratioの計算方法

Calmar Ratio(カルマーレシオ)の定義式

Calmar Ratio=\frac{CAGR(n)}{MDD_{max}^{(n)}}

CAGRの定義式はこちらに記載しています。
数値は大きいほど好ましいです。

補足 : Shapen Ratioに比べて、Calmar Ratioは最悪の下落率を考慮した指標になっている。

2-4 Calmar Ratioの計算式コード例

test.py
def CAGR(DF):
    df = DF.copy()
    df["daily_ret"] = DF["Close"].pct_change() #株価終値の前日との変化率を計算する。
    df["cum_return"] = (1 + df["daily_ret"]).cumprod() #cumprod(全要素の累積積を スカラーyに返します.
    n = len(df)/252 #1年の取引日を252日に設定している。
    print( "df[cum_return]" )    
    print( df["cum_return"] )
    print( "df[cum_return][-1] ")           
    print( df["cum_return"][-1] )    
    CAGR = (df["cum_return"][-1])**(1/n) - 1
    return CAGR

def max_dd(DF):
    "function to calculate max drawdown"
    df = DF.copy()
    df["daily_ret"] = DF["Close"].pct_change()
    df["cum_return"] = (1 + df["daily_ret"]).cumprod()  #cumprod()全要素の掛け算を行う。
    print(df["cum_return"])

    #ax.legend() #凡例を描写する
    df["cum_roll_max"] = df["cum_return"].cummax()
    df["drawdown"] = df["cum_roll_max"] - df["cum_return"]
    df["drawdown_pct"] = df["drawdown"]/df["cum_roll_max"]
    max_dd = df["drawdown_pct"].max()
    ax=df["cum_return"].plot(marker="*",figsize=(10, 5))    
    ax=df["cum_roll_max"].plot(marker="*",figsize=(10, 5))    
    ax=df["drawdown"].plot(marker="*",figsize=(10, 5))   
    ax=df["drawdown_pct"].plot(marker="*",figsize=(10, 5))       
    ax.legend() #凡例を描写する
    return max_dd

def calmar(DF):
    "function to calculate calmar ratio"
    df = DF.copy()
    clmr = CAGR(df)/max_dd(df)
    return clmr
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1