Support Board
Date/Time: Wed, 12 Mar 2025 12:10:34 +0000
Post From: ACSIL Getting Order Price Information
[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); |