Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 04:06:57 +0000



Post From: How to get ClosedProfitLoss of an order. in ACSIL, given the InternalOrderID

[2019-10-20 03:19:54]
User272786 - Posts: 13
Dear Support,

GetOrderByIndex(s_SCTradeOrder) => s_SCTradeOrder does not have ClosedProfitLoss values.

GetTradeListEntry(s_ACSTrade) => has s_ACSTrade.ClosedProfitLoss values, but can not be searched for the order using InternalOrderID.

I tried a work around using s_ACSTrade.OpenDateTime to find the order, as from GetOrderByOrderID(s_SCTradeOrder), we can access s_SCTradeOrder.EntryDateTime when a new order was created.
Used something like s_ACSTrade.OpenDateTime.GetTimeWithoutMilliseconds() == s_SCTradeOrder.EntryDateTime.GetTimeWithoutMilliseconds() this, sometimes does not work, as it seems sometimes the TimeStamp differs a bit when an order is fillted.It would have worked if that comaprison worked at millisecond level, as it would most probably be unique accross orders for most of the requirements.

What am I missing here? What is the easiest way to get ClosedProfitLoss of an order, when it's InternalOrderID is known? Thanks
Date Time Of Last Edit: 2019-10-20 03:55:45