Support Board
Date/Time: Mon, 29 Apr 2024 04:22:04 +0000
Post From: Quantity Distribution from Parent Order to Multiple Attached Orders in ACSIL
[2019-03-26 13:21:36] |
User525733 - Posts: 126 |
folks, i have a follow up on this, I want to create the following in ACSIL: a parent order with 3 lots, two separate targets each having quantity = 1, and the final contract should exit using triggered trailing stop that triggers on 2nd target fill. I also want the common stop to move to BE once the 1st target fills. The below code didn't work...can you please advise: s_SCNewOrder NewOrder;
NewOrder.OrderQuantity = 3; NewOrder.OrderType = SCT_ORDERTYPE_MARKET; NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED; //Define the Attached Orders to be attached to the main Market order //Target 1 NewOrder.Target1Offset = 4 * sc.TickSize; NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT; //Target 2 NewOrder.Target2Offset = 20 * sc.TickSize; NewOrder.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT; //Common Stop NewOrder.StopAllOffset = 16 * sc.TickSize; NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_TRIGGERED_TRAILING_STOP_LIMIT_3_OFFSETS; NewOrder.TriggeredTrailStopTriggerPriceOffset = 8 * sc.TickSize; NewOrder.TriggeredTrailStopTrailPriceOffset = 4 * sc.TickSize; //Set up a move to breakeven action for the common stop. When Target 1 is filled, the order will be moved to breakeven +1 NewOrder.MoveToBreakEven.Type = MOVETO_BE_ACTION_TYPE_OCO_GROUP_TRIGGERED; NewOrder.MoveToBreakEven.BreakEvenLevelOffsetInTicks = 0; NewOrder.MoveToBreakEven.TriggerOCOGroup = OCO_GROUP_1; |