Date/Time: Thu, 18 Oct 2018 04:20:51 +0000
MARKET IF TOUCHED OCO
|User28317 - Posts: 76|
I have a study that places automated OCO Trades. Target Order should be set to Limit, Stop to Market If Touched. The orders are placed mostly correctly with the exception of the Stop order, which is placed as Limit. I tried to force the Market If touched type, and explicitely set all Stop Order Groups to Merket If touched, but it doesn't change anything.
The relevant code is:
// Setting price for entry, target and stop
order.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop1Type = SCT_ORDERTYPE_MARKET_IF_TOUCHED;
order.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop2Type = SCT_ORDERTYPE_MARKET_IF_TOUCHED;
order.AttachedOrderTarget3Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop3Type = SCT_ORDERTYPE_MARKET_IF_TOUCHED;
order.AttachedOrderTarget4Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop4Type = SCT_ORDERTYPE_MARKET_IF_TOUCHED;
order.AttachedOrderStopAllType = SCT_ORDERTYPE_MARKET_IF_TOUCHED;
order.OCOGroup1Quantity = 1;
order.OrderQuantity = t.amount_;
if (sc.BuyEntry(order) < 0)
sc.AddMessageToLog("Failed to submit order to the trading service.", 0);
What exactly am I doing wrong?
Sierra Chart Engineering - Posts: 64936
You cannot use a market if touched order as a stop. You must use a Stop type.
Sierra Chart Support - Engineering Level
Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
To post a message in this thread, you need to login with your Sierra Chart account: