Support Board
Date/Time: Fri, 31 Jan 2025 20:09:33 +0000
Post From: missing data in s_SCTradeOrder
[2019-05-17 11:52:18] |
PK - Posts: 12 |
Hi, -I get trade information using s_SCTradeOrder -I have an attached entry order with 1 StopAllOrder, and 3 Target Orders -The entry order already filled but the entry order quantity just equal the Third Target Order quantity (it should be the sum of all 3 Target Orders' quantity) -I read your documentation and found that when using StopAllOrder, the Stop order is automatically generated for every Target order, so I got the InternalOrderID for every Stop Order in addition to StopAllOrderID. -I use InternalOrderID for target orders and stop orders to get the detail information using s_SCTradeOrder, but there is no information when I use Stop1InternalOrderID, Stop2InternalOrderID, Stop3InternalOrderID. So, in summary, there are two key problems: 1. Filled Entry Order quantity is mismatching with position quantity (just equal Third Target Order quantity) 2. There is no information for Stop1, Stop2, Stop3 order Please see the code below: //Getting Trade information s_SCTradeOrder OrderDetails; if (sc.GetOrderByOrderID(i_NewOrderID,OrderDetails) !=SCTRADING_ORDER_ERROR && OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Target1OrderDetails; if (sc.GetOrderByOrderID(i_TargetOrderID1,Target1OrderDetails) !=SCTRADING_ORDER_ERROR && Target1OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Target2OrderDetails; if (sc.GetOrderByOrderID(i_TargetOrderID2,Target2OrderDetails) !=SCTRADING_ORDER_ERROR && Target2OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Target3OrderDetails; if (sc.GetOrderByOrderID(i_TargetOrderID3,Target3OrderDetails) !=SCTRADING_ORDER_ERROR && Target3OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder StopAllOrderDetails; if (sc.GetOrderByOrderID(i_StopAllOrderID,StopAllOrderDetails) !=SCTRADING_ORDER_ERROR && StopAllOrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Stop1OrderDetails; if (sc.GetOrderByOrderID(i_StopOrderID1,Stop1OrderDetails) !=SCTRADING_ORDER_ERROR && Stop1OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Stop2OrderDetails; if (sc.GetOrderByOrderID(i_StopOrderID2,Stop2OrderDetails) !=SCTRADING_ORDER_ERROR && Stop2OrderDetails.InternalOrderID!=0) { } s_SCTradeOrder Stop3OrderDetails; if (sc.GetOrderByOrderID(i_StopOrderID3,Stop3OrderDetails) !=SCTRADING_ORDER_ERROR && Stop3OrderDetails.InternalOrderID!=0) { } |