Skip to content

Add IBKR-native --order-ref for order tagging#5

Open
nixoid wants to merge 1 commit into
fatwang2:mainfrom
nixoid:feat/order-ref
Open

Add IBKR-native --order-ref for order tagging#5
nixoid wants to merge 1 commit into
fatwang2:mainfrom
nixoid:feat/order-ref

Conversation

@nixoid

@nixoid nixoid commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • Add --order-ref on buy/sell to set TWS API orderRef (kept for the order lifetime; bracket children use {ref}-tp / {ref}-sl)
  • Expose order_ref on open/completed orders and executions, with optional --order-ref-prefix filtering
  • Preserve orderRef through modify via _build_clean_modify_order, plus unit tests and README docs

Test plan

  • python -m unittest tests.test_cli tests.test_config tests.test_order_ref -v (28 passed)
  • Paper Gateway: ibkr sell <SYM> 1 --type LMT --limit <px> --order-ref fr-test-1 --submit --profile gateway-paper
  • ibkr orders open --order-ref-prefix fr- --profile gateway-paper shows the tagged order
  • Cancel the test order afterward

Made with Cursor

Expose orderRef on place/list/modify paths with optional prefix filtering so agents can own orders without inventing a parallel client-order-id concept.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nixoid

nixoid commented Jul 8, 2026

Copy link
Copy Markdown
Author

It's an essential feature when running multiple strategies from single account

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