Fix critical and major issues identified in codebase review#31
Merged
Conversation
Critical: - get_vwap() for IDC now returns true session VWAP (volume-weighted average of all historical trades) instead of last trade price. Added _vwap_accum accumulator to ContinuousMatchingEngine and a get_session_vwap() method. - Auto-discovered signals in _discover_signals() now emit an explicit WARNING about look-ahead bias before creating the CsvSignalProvider, making the risk visible at engine level in addition to the provider-level warning. Major: - Subscribed signals that are never dispatched (due to data range mismatches or incorrect publication_offset) now trigger a WARNING at the end of run() instead of silently producing no signal updates for the entire backtest. - Test files no longer construct _BacktestContext directly. Added tests/testing_utils.py with a make_minimal_backtest_context() factory that centralises the internal import. Both test_delivery_position.py and test_algo_decorator.py now import from tests.testing_utils. https://claude.ai/code/session_01XqYtc2t1oCV8eTmXN8aaiY
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Critical:
get_vwap() for IDC now returns true session VWAP (volume-weighted average
of all historical trades) instead of last trade price. Added _vwap_accum
accumulator to ContinuousMatchingEngine and a get_session_vwap() method.
Auto-discovered signals in _discover_signals() now emit an explicit WARNING
about look-ahead bias before creating the CsvSignalProvider, making the risk
visible at engine level in addition to the provider-level warning.
Major:
Subscribed signals that are never dispatched (due to data range mismatches
or incorrect publication_offset) now trigger a WARNING at the end of run()
instead of silently producing no signal updates for the entire backtest.
Test files no longer construct _BacktestContext directly. Added
tests/testing_utils.py with a make_minimal_backtest_context() factory that
centralises the internal import. Both test_delivery_position.py and
test_algo_decorator.py now import from tests.testing_utils.
https://claude.ai/code/session_01XqYtc2t1oCV8eTmXN8aaiY