Skip to content

Fix symbol changed events emission time#8552

Merged
jhonabreul merged 4 commits intoQuantConnect:masterfrom
jhonabreul:bug-8464-new-mapped-symbol-security
Jan 23, 2025
Merged

Fix symbol changed events emission time#8552
jhonabreul merged 4 commits intoQuantConnect:masterfrom
jhonabreul:bug-8464-new-mapped-symbol-security

Conversation

@jhonabreul
Copy link
Collaborator

Description

Ensure the symbol changed events are emitted after the securities are processes by the main loop in the AlgorithmManager. This way the algorithm has access to the new symbol security since it would be added by the securities processing logic.

Also, allow all securities to be properly updated, including prices and cash, before emitting the event, so that the any logic (like placing orders) done by the algorithm on the handler has the correct data.

Related Issue

Closes #8464

Motivation and Context

Requires Documentation Change

How Has This Been Tested?

Regression algorithms

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>

Ensure the symbol changed events are emitted after the securities are processes by the main loop in the AlgorithmManager. This way the algorithm has access to the new symbol security since it would be added by the securities processing logic.

Also, allow all securities to be properly updated, including prices and cash, before emitting the event, so that the any logic (like placing orders) done by the algorithm on the handler has the correct data.
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 👍

@jhonabreul jhonabreul merged commit c5c56bf into QuantConnect:master Jan 23, 2025
6 of 7 checks passed
@jhonabreul jhonabreul deleted the bug-8464-new-mapped-symbol-security branch January 23, 2025 22:29
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.

New Symbol is not Available When OnSymbolChangedEvents is Called

2 participants