Enable smart DCA IBKR runtime - #101
Merged
Merged
Conversation
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.
Issue
The IBKR platform did not yet expose the new Nasdaq/S&P 500 Smart DCA profile. The platform runtime also used a fixed 2% rebalance threshold, which is suitable for rotation strategies but can block intentional small DCA buy orders.
Cause and effect
Smart DCA emits buy-only value targets from market history plus the live portfolio snapshot. Without requiring the portfolio snapshot and without honoring the strategy-level execution threshold, a valid monthly DCA plan could be evaluated with incomplete context or skipped by the execution layer.
Fix
us-equity-strategiesto the merged smart DCA threshold release.nasdaq_sp500_smart_dcato supported IBKR profiles and documentation.portfolio_snapshotwhen the strategy contract or runtime adapter asks for it.managed_symbolsin runtime metadata so QQQM/SPLG are priced and tracked.execution_rebalance_threshold_ratiofrom strategy config, falling back to existing defaults.Validation
timeout 120 .venv/bin/ruff check strategy_runtime.py main.py notifications/telegram.py tests/test_strategy_runtime.py tests/test_runtime_config_support.py tests/test_connect_timeout_alert.py tests/test_notifications.pytimeout 180 .venv/bin/python -m pytest tests/test_strategy_runtime.py tests/test_strategy_loader.py tests/test_runtime_config_support.py -qtimeout 120 .venv/bin/python -m pytest tests/test_connect_timeout_alert.py tests/test_notifications.py tests/test_strategy_runtime.py tests/test_runtime_config_support.py -qtimeout 180 .venv/bin/python -m pytest -q