Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 02:04:38 +0000



[Programming Help] - Does ACS allow to set OCO attached group quantity less than quantity in main order

View Count: 456

[2020-07-13 16:56:55]
User824278 - Posts: 2
I wrote below code. It aims to stop or limit 50% quantity of main order in attached OCO order, and another 50% stop is controlled in other order (ORDERTYPE_STOP).

  newOrder.OrderQuantity = 10;
  newOrder.OrderType = SCT_ORDERTYPE_MARKET;
  newOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED;

  newOrder.Target1Offset = targetOffset * sc.TickSize;
  newOrder.Stop1Offset = stopOffset * sc.TickSize;
  newOrder.OCOGroup1Quantity = 5;
  newOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
  newOrder.AttachedOrderStop1Type = SCT_ORDERTYPE_STOP;

  sc.BuyEntry(newOrder);

But I found 10 units are selt when OCO STOP is touched, instead of 5 units. Why? Does SC ask the total quantity in all OCO groups must equal to the quantity in main order?

Thanks a lot.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account