[Question] How to set up OCA orders? #17
Unanswered
moritzkork
asked this question in
Q&A
Replies: 1 comment
-
Please take a look to the examples-gem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
first of all - thank you for the wonderful work on the ib-api gems, it is a pleasure to work with them, even for a Ruby beginner like me!
I am struggling with setting up OCA (One-Cancels-Another order groups) for my positions and would appreciate code examples
I've placed an OCA order in TWS manually, (sample order for apple:one LMT SELL order 50% above current price, one STP 80% below), then tried to look up the order through the console / byebug
the order does show up via (IB::Gateway.current.client.orders), but only the first of the OCA group (the LMT order), the STP Limit is missing... :
:oca_group
(unique String) and:oca_type
(either 1 , 2 or 3)(https://interactivebrokers.github.io/tws-api/classIBApi_1_1Order.html#a3485999c42d64f3c879ec4a424bab697)with the two separate LMT SELL and STP orders, but I get an alert:
IB Alert:: TWS Error 201: Order rejected - reason:OCA handling method mismatch
:oca:group
identifier and the:oca_type
?I appreciate any help - and I'd be happy to write something up for the documentation after this is solved!
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions