Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 20:21:17 +0000



Post From: Quantity Distribution from Parent Order to Multiple Attached Orders in ACSIL

[2019-03-27 12:41:13]
User525733 - Posts: 126
I tried the below and it didn't work:


// Create an s_SCNewOrder object.
  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 = In_target1.GetFloat() * sc.TickSize;
  NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;

  //Target 2
  NewOrder.Target2Offset = In_target2.GetFloat() * sc.TickSize;
  NewOrder.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;

  //Common Stop
  NewOrder.StopAllOffset = In_commonstop.GetFloat() * sc.TickSize;
  NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_TRIGGERED_TRAILING_STOP_LIMIT_3_OFFSETS;
  NewOrder.TriggeredTrailStopTriggerPriceOffset = In_TriggeredTrailStopTriggerPriceOffset.GetFloat() * sc.TickSize;
  NewOrder.TriggeredTrailStopTrailPriceOffset = In_TriggeredTrailStopTrailPriceOffset.GetFloat() * 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;

  NewOrder.OCOGroup1Quantity = 1;
  NewOrder.OCOGroup2Quantity = 1;
  NewOrder.OCOGroup3Quantity = 1;

please pay attention to the requirements mentioned in post #5. Only TWO contracts should exit on fixed targets, the THIRD one should exit on the trailing stop. not sure what i am doing wrong/how to implement it?

thanks