Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 22:48:32 +0000



Post From: Modifying a Stop Limit Opened Order

[2023-04-05 08:31:28]
User431178 - Posts: 544
but the price is cero before and after modifying it.

Message.Format("ModifyOrder ID: %i and ModifyOrder Price: %i",ModifyOrder.InternalOrderID, ModifyOrder.Price1);

%i is not correct for price, should be %f

ModifyOrder.OrderType = SCT_OSC_OPEN;
Maybe remove this line as SCT_OSC_OPEN is not an order type, nor do you have to set the order type when modifying the price level using sc.ModifyOrder
SCT_OSC_OPEN is type SCOrderStatusCodeEnum and implicitly converts to int with value 5, which actually makes it equivalent to SCT_ORDERTYPE_LIMIT_CHASE


Maybe do what is suggested previously by Sierra Chart Engineering and check the Trade >> Trade Activity Log to see what might be happening.

You could also add the code below to print a message to the log if the modify action fails
        
auto result = sc.ModifyOrder(ModifyOrder);

if (result < 0)
sc.AddMessageToLog(sc.GetTradingErrorTextMessage(result), 0, 1);