Login Page - Create Account

Support Board


Date/Time: Wed, 12 Mar 2025 05:47:46 +0000



[Programming Help] - ACSIL Getting Order Price Information

View Count: 997

[2022-05-06 17:53:15]
User681288 - Posts: 6
Hi, I've poured over the documentation and the TradingSystem.cpp and probably just can't see for looking but could you help. I am trying to retrieve the price information for an open order. My code is correctly setting a buystop order and I am able to loop through all orders and find the appropriate one. I need to be able to retrieve the price for the selected order OrderDetails.??? AvgFillPrice returns 0 (as the order hasn't filled) Price1 returns 0 (as presumably this is only an input for s_SCNewOrder?). I couldn't find alternatives in the docs. Could you point me in the direction of how to do this. The code below all works as intended except for the line to get OrderPrice. (obviously, not with the question marks:) )
Thanks in advance

while (sc.GetOrderByIndex(i, OrderDetails) != SCTRADING_ORDER_ERROR)// loop through the orders
{
i++; // Increment the index for the next call

if (OrderDetails.ParentInternalOrderID != 0) // Attached Order
{
continue; // so ignore it and check next order
}
// if we are here, we found an open order
OrderStatusCode = OrderDetails.OrderStatusCode; // Get order status
OrderDirectionCode = OrderDetails.BuySell; // Get order direction
OrderPrice = OrderDetails.???????????????; // Get order price
DataString.Format("found order %d", OrderPrice);
sc.AddMessageToLog(DataString, 0);
[2022-05-06 20:32:48]
User681288 - Posts: 6
Never mind, Price1 it is... mixed up doubles and floats... my bad!

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

Login

Login Page - Create Account