Skip to content

Conversation

@adrianhasse
Copy link
Contributor

Note, that we decided against the geometric mean and when for the total return of each possible period as foundation for the box plot. This makes things easier and interpretative.

@adrianhasse adrianhasse requested a review from Copilot July 16, 2025 10:45
@adrianhasse adrianhasse linked an issue Jul 16, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds boxplot functionality to the Analyzer class to visualize rolling returns distribution for portfolio analysis. The implementation calculates total returns over specified periods and creates box plots to compare portfolio performance with optional benchmark data.

  • Adds plot_rolling_returns_distribution method to generate box plots of rolling returns
  • Makes trading parameters configurable through constructor arguments
  • Updates integration tests to cover the new boxplot functionality

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
kissbt/analyzer.py Adds boxplot method and makes trading hours/days configurable parameters
tests/test_integration.py Adds test coverage for the new boxplot functionality
.devcontainer/devcontainer.json Removes strict type checking mode configuration
Comments suppressed due to low confidence (2)

kissbt/analyzer.py:42

  • [nitpick] The variable name 'bar_unit' is inconsistent with the original 'unit' variable name. Consider keeping 'unit' for consistency or updating all related variable references to use 'bar_unit'.
        bar_unit = bar_size[-1]

tests/test_integration.py:107

  • The test only verifies that the method doesn't raise an exception but doesn't test edge cases like window size validation, benchmark inclusion/exclusion, or verify the actual box plot output.
    analyzer.plot_rolling_returns_distribution(252)

adrianhasse and others added 2 commits July 16, 2025 13:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adrianhasse adrianhasse merged commit cf0cbf6 into main Jul 16, 2025
7 of 8 checks passed
@adrianhasse adrianhasse deleted the feature/rolling-window-return-box-plots branch July 16, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: rolling‑window return box plots with geom.‑mean overlay

2 participants