API Support Forum
OEC API > API Support > SendLinkedOrders Multiple Order Support
Author Topic: SendLinkedOrders Multiple Order Support
(4 messages, Page 1 of 1)
Moderators: VPfau
Posts: 4
Joined: Oct 31, 2018

Posted: Mar 24, 2020 @ 04:28 PM             Msg. 1 of 4
I'm migrating our application to the latest GFAPI (v4.0.3.23) and I noticed the IOrdersAPI.SendLinkedOrders method was removed since my initial integration with the GFAPI. I've read the IOrdersAPI.SendOSOOrders method is the intended replacement method, but my application sends a list OCO draft orders (i.e. more than two orders) as an atomic operation. Is there a IOrdersAPI method I can use for my scenario or another technique to keep my operation atomic?


Posts: 135
Joined: Oct 26, 2011

Posted: Mar 25, 2020 @ 01:55 PM             Msg. 2 of 4
Hello Dave,

So far you can use only IOrdersAPI.SendOSOOrders function which send OSO with OCO pair. More than that, if you send multiple orders thru 3.5 OECAPI SendLinkedOrders function, only 2 OCO will be accepted. Other orders will be ignored.
Vitaliy Pfau
Posts: 1
Joined: Mar 25, 2020

Posted: Mar 25, 2020 @ 02:09 PM             Msg. 3 of 4
Since the API doesn't have the capability to create an OSO with more than an OCO pair. Do you have any guidance on how to support a scenario like this:

1. Create a buy order
2. If buy order filled, create a set of orders to close position (e.g. market delayed order, trailing stop, limit). If any of these position closing orders execute, I'd like to cancel the other two orders.

Thanks again for the much appreciated help.


Posts: 135
Joined: Oct 26, 2011

Posted: Mar 25, 2020 @ 02:23 PM             Msg. 4 of 4

it is the SendOSOOrders function:
IReadOnlyList SendOSOOrders(OrderDraft main, OrderDraft other, OrderDraft oco, OSOGroupingMethod groupingMethod);

you send 'main' OSO order and two OCO on it. As soon as 'main' order get filled 'other' and 'oco' increase qty. As 'oco' or 'other' get filled another leg get cancelled.
Vitaliy Pfau