Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 16:46:14 +0000



Post From: TriggeredTrailStopTriggerPriceOffset is being ignored for attached order

[2017-11-07 12:22:29]
User287992 - Posts: 51
I have StopLimit order with TriggeredTrailingStop order attached with trigger price offset set, but Stop order starts to trail immediately. Strategies built on v1614 and before worked well with same code (at the moment using version 1635)

s_SCNewOrder NewOrder;
NewOrder.OrderQuantity = (unsigned int) OrderAmount;
NewOrder.OrderType = SCT_ORDERTYPE_STOP_LIMIT;
NewOrder.AttachedOrderStop1Type = SCT_ORDERTYPE_TRIGGERED_TRAILING_STOP_3_OFFSETS;
NewOrder.TriggeredTrailStopTriggerPriceOffset = TicksForTrailingStopLoss * sc.TickSize;
NewOrder.TriggeredTrailStopTrailPriceOffset = TrailingStopTickDistance * sc.TickSize;

NewOrder.TimeInForce = SCT_TIF_GTC;

NewOrder.Price1 = HighData[sc.Index-1] + OrderHighLowOffset * sc.TickSize;
NewOrder.Price2 = NewOrder.Price1;
NewOrder.Stop1Price = NewOrder.Price1 - StopLoss * sc.TickSize;

Result = sc.BuyEntry(NewOrder);
...


Attached order has following parameters set:
Price1: 1727.4, Price2: 1727.4
Type: 9, TriggerOffset: 2.000000, TrailOffset: 0.200000, StopPrice: 1725.40

It starts trailing immediately, even before fullfilling the Offset (it should trail after hitting 1729.4)
imagePaused 300X GC-201708-NYMEX [CB] [M] 5 Min #1 2017-11-07 .png / V - Attached On 2017-11-07 12:19:12 UTC - Size: 48.37 KB - 413 views
attachmentTradeActivityLog.txt - Attached On 2017-11-07 12:21:33 UTC - Size: 3.79 KB - 350 views