Skip to content

Support per-account IBKR gateway ports - #98

Merged
Pigbibi merged 1 commit into
mainfrom
feature/ibkr-multi-gateway-config
May 26, 2026
Merged

Support per-account IBKR gateway ports#98
Pigbibi merged 1 commit into
mainfrom
feature/ibkr-multi-gateway-config

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add optional ib_gateway_port to IBKR account group runtime settings so multiple Gateway sessions can share one VM on different host ports.
  • Keep strategy plugin summaries out of regular heartbeat/trade notifications; plugin alerts remain standalone.
  • Update rollout docs and account-group example.

Validation

  • PYTHONPATH=.:/home/ubuntu/Projects/QuantPlatformKit/src:/home/ubuntu/Projects/UsEquityStrategies/src timeout 180 .venv/bin/python -m pytest tests/test_runtime_config_support.py tests/test_event_loop.py::test_account_group_can_override_ib_gateway_port tests/test_event_loop.py::test_ib_gateway_mode_derives_paper_port tests/test_account_group_examples.py tests/test_strategy_runtime.py tests/test_request_handling.py::test_build_extra_notification_lines_includes_account_id tests/test_request_handling.py::test_handle_request_sends_escalated_strategy_plugin_alert -q
  • timeout 120 .venv/bin/python -m ruff check README.md docs/examples/ibkr-account-groups.paper.json docs/ibkr_runtime_rollout.md main.py runtime_config_support.py tests/test_account_group_examples.py tests/test_event_loop.py tests/test_request_handling.py tests/test_runtime_config_support.py tests/test_strategy_runtime.py

@Pigbibi
Pigbibi merged commit 0c02f37 into main May 26, 2026
1 check failed
@Pigbibi
Pigbibi deleted the feature/ibkr-multi-gateway-config branch May 26, 2026 07:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a83846ab07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread runtime_config_support.py
Comment on lines +159 to +162
group_config.ib_gateway_port
if group_config.ib_gateway_port is not None
else parse_optional_int(os.getenv("IB_GATEWAY_PORT"))
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop using legacy env as implicit port override

When ib_gateway_port is omitted from the selected account group, this path now pulls IB_GATEWAY_PORT from the process env before applying the live/paper defaults. In deployments that still carry a legacy IB_GATEWAY_PORT, that stale global value silently overrides group behavior and can route a paper account group to the live gateway port (or vice versa), which undermines the per-account-port rollout and can direct orders to the wrong Gateway session.

Useful? React with 👍 / 👎.

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.

1 participant