Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible trading days per year property #7690

Conversation

Romazes
Copy link
Collaborator

@Romazes Romazes commented Jan 10, 2024

Description

Create new algorithm settings' property: TradingDaysPerYear. Which help user setup custom value for different brokerage or use in default state.
Characteristics of new property:

  • may be changeable by user
  • return diferent value depend on Brokerage
  • have defaul value

Related Issue

Closes #7562

Motivation and Context

  1. remove hardcoded values.
  2. increase quality calculation in PortfolioStatistics

Requires Documentation Change

N/A

How Has This Been Tested?

Custom Algorithm Initialization:
  • Extended support for all available BrokerageModels.
  • Validated tradingDaysPerYear accuracy across BrokerageModels.
Backward Compatibility Testing:
  • Confirmed tradingDaysPerYear returns 252 without BrokerageModel in all scenarios.
  • Tested reports with and without AlgorithmConfiguration for compatibility.
Regression Testing:
  • Tests demonstrated enhanced accuracy for certain values (screen below).

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Copy link
Collaborator

@jhonabreul jhonabreul left a comment

Choose a reason for hiding this comment

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

Thank you! Leaving a few minor comments

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

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

Thank you! 🚀

fix: hardcoded value to tradingDaysPerYear
Copy link
Collaborator

@jhonabreul jhonabreul left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

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

Thank you! 🚀

@Martin-Molinero Martin-Molinero merged commit 1eaf4d6 into QuantConnect:master Jan 17, 2024
8 of 10 checks passed
@Romazes Romazes deleted the bug-7562-algorithm-settings-flexible-trading-days-per-year branch January 19, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants