Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 04:58:30 +0000



Problem with OCO bracket entry orders

View Count: 830

[2017-05-19 17:40:04]
Al SC Developer - Posts: 434
I am seeing intermittent issues with OCO bracket entry orders. I am building a simple buy and sell stop bracket with target and stop.

Generally they are working as expected, but occasionally the second side is not canceled when the first side is filled. This results in a position along with a pending set of orders for the opposite direction that should have been canceled on the fill.

The following is the code being used to submit the order:


// all trading vars are set at defaults

s_SCNewOrder NewOrder;

NewOrder.OrderType = SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP;
NewOrder.TimeInForce = SCT_TIF_GTC;
NewOrder.OrderQuantity = 1;
NewOrder.Price1 = LongLevel + sc.TickSize;
NewOrder.Price2 = ShortLevel - sc.TickSize;
NewOrder.Target1Offset = 5 * sc.TickSize;
NewOrder.Target1Offset_2 = 5 * sc.TickSize;
NewOrder.Stop1Price = ShortLevel - sc.TickSize;
NewOrder.Stop1Price_2 = LongLevel + sc.TickSize;
NewOrder.OCOGroup1Quantity = 1;

rc = sc.SubmitOCOOrder(NewOrder);

I am seeing this in the latest ver 1558, and it happens both with live data (sim mode) and when replayed back using accurate backtest mode.

Nothing is generated in the log or the trade service log. From the order of the entries in the trade activity log, it looks like the order is immediately filled, before the second order is sent. I have attached the trade activity log for a trade immediately after the initial fill.
Date Time Of Last Edit: 2017-05-19 17:42:58
Private File
[2017-05-20 18:27:23]
Sierra Chart Engineering - Posts: 104368
From the order of the entries in the trade activity log, it looks like the order is immediately filled, before the second order is sent.
Yes this is the problem. We have to see what to do about 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

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

Login

Login Page - Create Account