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


Posted: Apr 10, 2018 @ 12:14 AM             Msg. 1 of 2
Hi

We are struggling with trailing stop orders.

Here is the part of the code where we set the trailing parameters

if (order.TrailTicks > 0 && order.OrderType == JTEnumerations.OrderType.Stop)
{

myOrderDraft.SetTSData(myOrderDraft.Contract.CurrentPrice.LastPrice, (double)(order.TrailTicks - myOrderDraft.Contract.TickSize));
}

OEC.API.OrderParts myInvalidOrderParts = myOrderDraft.GetInvalidParts();

if (myInvalidOrderParts != OEC.API.OrderParts.None)
{
JTLogger.AppLog("JTOECOrderHandler.OrderSubmit: Order Error - myInvalidOrderParts: " + myInvalidOrderParts.ToString());
}


What's happening is we always end up with the "Extendedparameters" error coming back from GetInvalidParts

Any idea what we are doing wrong?

We are testing with a demo futures account with the ESM8 contract.

Cheers

Pete
Peter Davies
SRuscak
Posts: 50
Joined: Aug 24, 2017


Posted: Apr 10, 2018 @ 08:04 AM             Msg. 2 of 2
Hi Pete. Sorry to hear you're having trouble. We have plans to improve OrderDraft validation feedback but it's still a ways away.

I'm thinking that you need to set myOrderDraft.Type to either TrailingStopLimit or TrailingStopLoss.

Best regards,
Seth