quantstats
quantstats copied to clipboard
Add compounded flag to calmar() and rar()
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)
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.