Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 08:35:12 +0000



SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP Order not setting attached stops correctly

View Count: 887

[2017-01-16 14:48:10]
Al SC Developer - Posts: 434
When an OCO order of type SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP is submitted, the attached order stops are not always properly set. When the Stop1Price/Stop1Price_2 fields are used, the Stop1Price is used for the attached stop order for both OCO groups. When the Stop1Offset/Stop1Offset_2 fields are used, both stops are properly set.

Here is an example of an order that produces incorrect orders:


s_SCNewOrder NewOrder;
    
NewOrder.OrderType = SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP;
NewOrder.TimeInForce = SCT_TIF_GTC;
NewOrder.OrderQuantity = 2;
NewOrder.OCOGroup1Quantity = 1;
NewOrder.OCOGroup2Quantity = 1;

NewOrder.Price1 = LongEntryPrice;
NewOrder.Price2 = ShortEntryPrice;

NewOrder.Target1Offset = Target1OffsetInTicks * sc.TickSize;
NewOrder.Target2Offset = Target2OffsetInTicks * sc.TickSize;
NewOrder.Target1Offset_2 = Target1OffsetInTicks * sc.TickSize;
NewOrder.Target2Offset_2 = Target2OffsetInTicks * sc.TickSize;

// these work
//NewOrder.Stop1Offset = LongStopOffsetInTicks * sc.TickSize;
//NewOrder.Stop2Offset = LongStopOffsetInTicks * sc.TickSize;
//NewOrder.Stop1Offset_2 = ShortStopOffsetInTicks * sc.TickSize;
//NewOrder.Stop2Offset_2 = ShortStopOffsetInTicks * sc.TickSize;

// these fail, only using the first price for both groups
NewOrder.Stop1Price = LongStopPrice;
NewOrder.Stop2Price = LongStopPrice;
NewOrder.Stop1Price_2 = ShortStopPrice;
NewOrder.Stop2Price_2 = ShortStopPrice;
//NewOrder.StopAllPrice = LongStopPrice;
//NewOrder.StopAllPrice_2 = ShortStopPrice;


[2017-01-16 19:24:43]
Sierra Chart Engineering - Posts: 104368
We will look into this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-01-17 05:15:30]
Sierra Chart Engineering - Posts: 104368
This is now fixed.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account