quantstats icon indicating copy to clipboard operation
quantstats copied to clipboard

Add compounded flag to calmar() and rar()

Open atharvajoshi01 opened this issue 7 months ago • 1 comments

Fixes #507 and #510.

Both calmar() and rar() call cagr() internally but didn't expose its compounded parameter. For intraday or non-compounded return streams, geometric CAGR inflates these metrics.

Added compounded=True (backward compatible) to both functions, passed through to cagr().

# Before: always uses compounded CAGR
qs.stats.calmar(returns)

# Now: can use arithmetic returns
qs.stats.calmar(returns, compounded=False)
qs.stats.rar(returns, compounded=False)

atharvajoshi01 avatar Apr 12 '26 23:04 atharvajoshi01

this still bites users on intraday returns or non-compounded streams. default stays compounded=True so existing callers don't change. will rebase if there's drift on main.

atharvajoshi01 avatar Jun 08 '26 01:06 atharvajoshi01