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

Fix bug in LiveTradingRealTimeHandler #7696

Merged

Conversation

Marinovsky
Copy link
Collaborator

Description

So far, LiveTradingRealTimeHandler didn't take into consideration holidays nor early closes/late opens when refreshing the market hours for the Securities. In the same way, if certain update to the MHDB(MarketHoursDatabase) was done, it didn't upload its instance of the MHDB. This PR solves those bugs.

Related Issue

Close #7662

Motivation and Context

With this change, users will get accurate market hours for their securities when using LiveTradingRealTimeHandler, even after the MHDB is updated.

Requires Documentation Change

N/A

How Has This Been Tested?

There were created unit tests asserting the market hours assigned to the algorithm's securities took into consideration holidays, early closes and late opens. Additionally, it was asserted that the MHDB reset every time the method RefreshMarketHoursToday() was called.

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>

@Marinovsky Marinovsky force-pushed the bug-7662-LiveTradingHoursRefresh branch from 4ae4e2a to 9f2134d Compare January 16, 2024 19:08
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.

Thanks! 🚀 Leaving some minor commets here. Shared some others through Slack

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.

Thanks 👍 Looks good. Minor comment shared through Slack

@Marinovsky Marinovsky force-pushed the bug-7662-LiveTradingHoursRefresh branch from 3ff685c to f0c6a09 Compare January 19, 2024 20:44
@Martin-Molinero Martin-Molinero merged commit 518ab56 into QuantConnect:master Jan 24, 2024
10 checks passed
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.

Live Trading Market Hours Refresh
3 participants