Support Board
Date/Time: Sun, 24 Nov 2024 08:55:15 +0000
Post From: How to submit Trail stop and a limit OCO with ACSIL
[2024-06-16 21:02:22] |
User806682 - Posts: 14 |
I'm building a trading system with ACSIL and at one point once the system is in a position, I want to submit an OCO that has a trailing stop and a target limit order. I haven't been able to figure out to do this, and I've tried a few different configurations from the different forum posts I've read. For example, if the system is already LONG 1 contract. Here are two order types I've tried without success: // This order just flattens position because I think it doesn't have an OrderQuantity and it seems to default to a market order s_SCNewOrder NewOrder; NewOrder.OCOGroup1Quantity = 1; NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED; NewOrder.Target1Price = xxx; // This is a higher value than where the market is trading NewOrder.AttachedOrderStop1Type = SCT_ORDERTYPE_TRAILING_STOP; NewOrder.Stop1Offset = xxx; // This is a lower value than where the market is trading sc.SellOrder(NewOrder); // This order successfully submits the trailing stop but there is no target s_SCNewOrder NewOrder; NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED; NewOrder.OrderType = SCT_ORDERTYPE_TRAILING_STOP; NewOrder.OrderQuantity = 1; NewOrder.Price1 = xxx; // This is a lower value than where the market is trading NewOrder.Price2 = xxx; // This is a higher value than where the market is trading (expecting this to be the target) sc.SellOrder(NewOrder); Lastly, I noticed that it is possible to send this type of attached order manually using the trade window. I just need help on how to do this with ACSIL. Thank you. |