API Support Forum
OEC API > API Support > OCO Orders
Author Topic: OCO Orders
(2 messages, Page 1 of 1)
Moderators: VPfau
PDavies541
Posts: 21
Joined: Feb 01, 2013


Posted: Feb 27, 2018 @ 09:35 AM             Msg. 1 of 2
Hi

I'm struggling a little with OCO Orders - I'm not 100% sure if I need to do something to properly link them.

It seems to create OCO Orders of type "Cancel Cancels Other" whereas the OEC DOM seems to create them as "Fill or Cancel Cancels Other".


public void OrderSubmitOCO(List orders, JTEnumerations.OCOType type, string ocoId)
{
Dictionary ocoOrders = new Dictionary();
foreach (JTOrder ocoOrder in orders)
{
OEC.API.OrderDraft myOrderDraft = GetOECOrder(ocoOrder); // Creates OEC order from our internal order format
OEC.API.OrderParts myInvalidOrderParts = myOrderDraft.GetInvalidParts();
if (myInvalidOrderParts != OEC.API.OrderParts.None)
{
JTLogger.AppLog("JTOECOrderHandler.OrderSubmit: Order Error - myInvalidOrderParts: " + myInvalidOrderParts);
}
else
ocoOrders.Add(ocoOrder.InternalID, myOrderDraft);
}
client.SendOCOOrders(ocoOrders.Values.ToArray());
}


We are presuming this will link the orders together.

Any thoughts?

Thanks

Peter
Peter Davies
VPfau
Moderator
Posts: 164
Joined:


Posted: Feb 27, 2018 @ 02:51 PM             Msg. 2 of 2
There are two types of orders OSO (Order Sends Order) and OCO (Order Cancels Order)
Both types could be found in the advanced example https://bitbucket.org/GainFuturesDev/advancedexample
Vitaliy Pfau