Skip to content

Commit e1c3b61

Browse files
author
Tyler Patterson
committed
metrics fixes
1 parent 51c3d23 commit e1c3b61

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77

88
[project]
99
name = "quantalytics"
10-
version = "0.1.6"
10+
version = "0.1.7"
1111
description = "Modern quantitative analysis library for portfolio analytics, charts, and reports"
1212
readme = "README.md"
1313
keywords = [

quantalytics/analytics/metrics.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,23 @@ def sortino(
117117

118118
@overload
119119
def calmar(
120-
returns: Series, prepare_returns: bool = True, periods: int = 365
120+
returns: Series, prepare_returns: bool = True, periods: int | None = None
121121
) -> float: ...
122122
@overload
123123
def calmar(
124-
returns: DataFrame, prepare_returns: bool = True, periods: int = 365
124+
returns: DataFrame, prepare_returns: bool = True, periods: int | None = None
125125
) -> Series: ...
126126
def calmar(
127-
returns: Series | DataFrame, prepare_returns: bool = True, periods: int = 365
127+
returns: Series | DataFrame,
128+
prepare_returns: bool = True,
129+
periods: int | None = None,
128130
) -> float | Series:
129131
"""Calculates the calmar ratio (CAGR% / MaxDD%)"""
130132
if prepare_returns:
131133
returns = _utils.normalize_returns(data=returns)
132-
cagr_ratio = cagr(returns=returns, periods=periods)
134+
cagr_pct = cagr(returns=returns, periods=periods)
133135
max_dd = max_drawdown(returns=returns)
134-
return cagr_ratio / abs(max_dd)
136+
return cagr_pct / abs(max_dd)
135137

136138

137139
def autocorr_penalty(returns: Series | DataFrame, prepare_returns=False) -> float:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)