API Support Forum
User Profile

Viewing User Profile for: CKeslin1490


About

Oct 31, 2018 10:50 AM

Apr 20, 2020 03:10 PM

Apr 20, 2020 03:10 PM



Post Statistics
CKeslin1490 has contributed to 4 posts out of 5593 total posts (0.07%) in 1996 days (0.00 posts per day).

20 most recent posts:

API Support » Best way to cancel working orders when closing a position Apr 20, 2020 @ 03:10 PM (Total replies: 0)

What is the recommended best way to cancel existing OCO orders and close a position. Currently, we loop through the orders and cancel any existing order that the IsFinal is set to false, then we place a market order to close the position as in the original OEC example documentation. However, we're seeing orders not cancel and then open a reverse position after the original position is closed by a market order. Any suggestions appreciated.

Cheers,
--Chris

API Support » SendLinkedOrders Multiple Order Support Mar 24, 2020 @ 04:28 PM (Total replies: 3)

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?

Thanks,

Dave

API Support » SendLinkedOrders causes MKT order to hang in development environment Jan 10, 2020 @ 01:46 PM (Total replies: 2)

Thank you!

API Support » SendLinkedOrders causes MKT order to hang in development environment Jan 09, 2020 @ 10:56 AM (Total replies: 2)

Hello,

I'm attempting to send a MKT buy order that has a linked Stop order with based on the Fill price of the MKT order. If I do not include a price on the Stop order it has an invalid part and will not submit. Providing a price shouldn't be necessary because I want to go off the fill price of the MKT (which does not have a price, but works as expected)

If I send the MKT order alone, it is sent and filled as expected. If I send the MKT order as a SendLinkedOrders with the stop as shown in the code below, the MKT order hangs in the "sent" state and the stop order is "held". They never leave this state and I need support to clear the working orders for me because canceling them fails with "another cancel attempt is running"

Sample code that will reproduce the issue is below. Thanks in advance for your help.

var mainOrder = gainClient.CreateDraft();

mainOrder.Account = gainAccount;
mainOrder.Contract = gainContract;
mainOrder.Comments = "Main Order";
mainOrder.Quantity = 1;
mainOrder.Side = OrderSide.Buy;
mainOrder.Start = OEC.API.Version.MinimumStart;
mainOrder.End = OEC.API.Version.MaximumEnd;
mainOrder.Type = OrderType.Market;

if (OrderParts.None != mainOrder.GetInvalidParts())
return;

var draftStopOrder = gainClient.CreateDraft();

draftStopOrder.Account = gainAccount;
draftStopOrder.Contract = gainContract;
draftStopOrder.Comments = "Stop Order activated on MKT fill";
draftStopOrder.Quantity = 1;
draftStopOrder.Side = OrderSide.Sell;
draftStopOrder.Start = OEC.API.Version.MinimumStart;
draftStopOrder.End = OEC.API.Version.MaximumEnd;
draftStopOrder.Type = OrderType.Stop;
draftStopOrder.Price = 3598; //Shouldn't need to set this
draftStopOrder.DeltaTicks = -10;

var draftStopOrderInvalidParts = draftStopOrder.GetInvalidParts();

if (OrderParts.None != draftStopOrderInvalidParts)
return;

gainClient.SendLinkedOrders(mainOrder, OSOGroupingMethod.ByPrice, draftStopOrder);