Releases: ranaroussi/quantstats
v0.0.81 - Bugfixes for 0.0.78 release
Bugfixes for 0.0.78 release
-
Fixed circular import errors that broke
import quantstats(#499, #501) -
Fixed
NameError: name 'dd_get_stats' is not definedinreports.full()(#502) -
Fixed
reports.html()to work without specifying output file (opens in browser) -
Fixed
profit_ratio()to handle DataFrame inputs properly -
Removed dark mode CSS from HTML report template
-
Suppressed pandas FutureWarning for callable resampler.apply()
-
Improved HTML report header:
- Title shows "(Compounded)" only when compounded=True
- Date range shows "(matched dates)" only when match_dates=True with benchmark
- Parameters now always show Benchmark, Periods/Year, and RF rate
-
Added new metrics to full HTML report:
- Ulcer Performance Index, Risk-Adjusted Return, Risk-Return Ratio
- Avg. Return, Avg. Win, Avg. Loss, Win/Loss Ratio, Profit Ratio
-
Added terminal output parameters table for
reports.full()andreports.basic() -
Added comprehensive test suite (125 tests):
- Tests for stats, reports, utils, plots, compat, extend_pandas, and Monte Carlo
v0.0.78 - 2026 Modernization Update
2026 Modernization Update
New Features
- Monte Carlo Simulation Module - Bootstrap resampling for risk analysis
- HTML Report Parameters - Display custom parameters in report header (#472)
- Comprehensive Type Hints - Python 3.10+ union syntax throughout stats.py
Bug Fixes
- Fixed CVaR calculation for DataFrame inputs (#467)
- Fixed FutureWarning for pandas
pct_change()deprecatedfill_method - Fixed timezone normalization for cross-market comparisons
- Fixed EOY returns display with double "%" (#475)
- Fixed kdeplot warnings (#477)
- Fixed benchmark Omega calculation (#485)
- Fixed metrics inconsistencies (#480, #486)
- Fixed underwater plot average drawdown (#489)
- Fixed HTML report with benchmark Series (#491)
- Improved Chrome dark mode support (#492)
Compatibility
- Python 3.10+ required
- pandas >=1.5.0 (supports both 1.x and 2.x)
- numpy >=1.24.0
- Simplified compatibility layers for modern dependency versions
Closed Issues
#467, #472, #475, #477, #479, #480, #481, #484, #485, #486, #489, #491, #492
Full Changelog: https://github.com/ranaroussi/quantstats/blob/main/CHANGELOG.md
0.0.77
0.0.77
-
Fixed issue #467 - CVaR calculation returning NaN for DataFrame inputs:
- The conditional_value_at_risk() function now properly handles DataFrame inputs
- When filtering DataFrames, NaN values are now correctly removed before calculating the mean
- CVaR calculations are now consistent between Series and DataFrame inputs
- This fix ensures accurate risk metrics in HTML reports when using benchmarks
-
Confirmed issue #468 is already resolved:
- The "mode.use_inf_as_null" pandas option error reported in v0.0.64 no longer occurs
- This issue was resolved in a previous version through updates to pandas compatibility
What's Changed
- Fix CVaR calculation for DataFrames and confirm resolution of mode.use_inf_as_null error by @ranaroussi in #471
Full Changelog: 0.0.76...0.0.77
0.0.76
0.0.76
-
Fixed issue #457 - Inconsistent benchmark EOY returns in reports:
- Benchmark yearly returns now remain consistent regardless of strategy's trading calendar
- HTML reports preserve original benchmark data for accurate EOY calculations
- Previously, benchmark returns would change when aligned to different strategies' trading days
- Added comprehensive tests to verify benchmark consistency across different comparisons
-
Improved timezone handling for cross-market comparisons:
- All resampling operations now normalize timezones to prevent comparison errors
- Mixed timezone-aware and timezone-naive data can now be compared without errors
- Data is converted to UTC then made timezone-naive for consistent comparisons
- Fixes "Cannot compare dtypes datetime64[ns] and datetime64[ns, UTC]" errors
-
Fixed FutureWarning for pandas pct_change():
- Updated all pct_change() calls to use fill_method=None parameter
- Prevents "fill_method='pad' is deprecated" warnings in pandas 2.x
- Ensures compatibility with future pandas versions
0.0.75
0.0.75
- Fixed FutureWarning for deprecated pandas frequency aliases:
- Updated make_index default rebalance parameter from "1M" to "1ME"
- Ensures compatibility with pandas 2.2.0+ without warnings
- The _compat module already handles conversion for older pandas versions
Full Changelog: 0.0.73...0.0.75
0.0.74
Updates:
- Completed fix for issue #463 - DataFrame handling in qs.reports functions:
- kelly_criterion: Fixed improper use of 'or' operator with Series values
- Now properly detects Series vs scalar inputs
- Handles zero and NaN values correctly for DataFrames
- recovery_factor: Added proper DataFrame input handling
- Detects when max_dd is a Series and handles accordingly
- Prevents "truth value of Series is ambiguous" errors
- All functions now tested with qs.reports.html() and qs.reports.metrics() with benchmarks
- Verified working with exact code examples from issue reporters
- kelly_criterion: Fixed improper use of 'or' operator with Series values
Full Changelog: 0.0.73...0.0.74
0.0.73
Addressed issue #463
Full Changelog: 0.0.72...0.0.73
0.0.72
- Fixed ValueError "truth value of Series is ambiguous" for DataFrame inputs in multiple stats functions:
- sortino: Properly handles Series downside deviation from DataFrame inputs
- outlier_win_ratio: Handles Series positive_mean calculations correctly
- outlier_loss_ratio: Handles Series negative_mean calculations correctly
- risk_return_ratio: Handles Series standard deviation properly
- ulcer_performance_index: Handles Series ulcer index values
- serenity_index: Handles Series std and denominator calculations
- gain_to_pain_ratio: Handles Series downside calculations
- All functions now properly return Series for DataFrame inputs and scalars for Series inputs
0.0.71
Added comprehensive divide by zero protection across multiple stats functions
Full Changelog: 0.0.70...0.0.71
0.0.70
What's Changed
- Fixed chart naming inconsistency: renamed "Daily Active Returns" to "Daily Active Returns (Cumulative Sum)" and "Daily Returns" to "Daily Returns (Cumulative Sum)" to accurately reflect that charts show cumulative values (fixes issue #454)
- Fixed CAGR calculation bug where years were incorrectly calculated using calendar days instead of trading periods, causing drastically reduced CAGR values (fixes issue #458)
- Fixed inconsistent EOY returns for benchmarks by preserving original benchmark data for aggregation while aligning to strategy index for other calculations (fixes issue #457)
Full Changelog: 0.0.69...0.0.70