Skip to content

Commit 421d80d

Browse files
committed
chore: get_rolling_fn must accept CAGR as well as cagr parameter values
1 parent b4cc092 commit 421d80d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

okama/common/helpers/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ def get_annual_return_ts_from_monthly(
224224
"""
225225
Annual Rate of Returns time series from monthly data.
226226
"""
227-
if return_type == "cagr":
227+
if return_type.lower() == "cagr":
228228
ts = ror_monthly.resample("A").apply(lambda x: np.prod(x + 1.0) - 1)
229-
elif return_type == "arithmetic_mean":
229+
elif return_type.lower() == "arithmetic_mean":
230230
ts = ror_monthly.resample("A").sum()
231231
else:
232232
raise ValueError("Return type must be either cagr or arithmetic_mean.")

0 commit comments

Comments
 (0)