API Support Forum
OEC API > Order Execution > Error In TrailingStopLoss order type
Author Topic: Error In TrailingStopLoss order type
(2 messages, Page 1 of 1)
Moderators: VPfau
Posts: 27
Joined: Sep 21, 2017

Posted: Apr 27, 2020 @ 10:36 AM             Msg. 1 of 2
Hi Team ,

I hope you are doing well.
I am getting below error while I am placing order as TrailingStopLoss .Please let me know. what I am doing wrong:

TrailingStopData and either TrailingStopLimit or TrailingStopLoss must be defined together

Order Draft :

OrderDraft slOrder = new GF.Api.Orders.Drafts.OrderDraft(OrderSide.Buy,
order.Contract.ID, "comment", order.Account.ID, null, null, 2.0, OrderType.TrailingStopLoss,
_price, null, OrderFlags.GTC, ExecInst.None, null, null, null, null, null, null, SubmissionType.Automatic, null, null);

Kapil Goyal
Posts: 6

Posted: Apr 28, 2020 @ 07:52 AM             Msg. 2 of 2
Looks like you are trying to pass a TrailingStopData trailingStopData parameter as null.

To create order, adjusted to the market price its need to set two components is 'price' and 'delta'.
Please use a TrailingStopData Class to set the values.

Thanks for reaching out.
Ruslan Bduov