API Support Forum
User Profile

Viewing User Profile for: CKeslin1490


About

Oct 31, 2018 10:50 AM

Mar 24, 2020 04:28 PM

Mar 24, 2020 04:28 PM



Post Statistics
CKeslin1490 has contributed to 3 posts out of 4631 total posts (0.06%) in 523 days (0.00 posts per day).

20 most recent posts:

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);