Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 17:39:02 +0000



Post From: Automate a stop with a manual limit order once the order is in a trade

[2017-07-10 20:45:23]
Joel Wisdo - Posts: 15
I am using s_ACSTrade to pull info from the entry to find the stop price from the entry point. Here is my code to initiate the stop order. It launches a sell order also though. I guess the easiest way to maybe approach this is to launch a "sell" if the trade is an "buy" but for some reason the code will not launch a "sell" order. Is there something in the sc.defaults that will allow this? Remember there is are 2 manual orders on the DOM. 1 Limit Order and 1 Working Order.

HardStop = CurrentPrice - (AdjustStop.GetInt() * sc.TickSize);
s_SCNewOrder NOrder;
NOrder.OrderQuantity = OrderQuantity.GetInt();

NOrder.AttachedOrderStop1Type = SCT_ORDERTYPE_STOP;
NOrder.Stop1Price = HardStop;
NOrder.InternalOrderID2 = Stop1ID;

int Result = sc.SellEntry(NOrder);