Trade ID Matching
Trade ID Matching
18 Jul 2020, 14:37
Hi Panagiotis,
is the trade ID in the cBots a different ID than what is displayed in the desktop version?
1. When I open a trade and partially close it with ModifyPosition all I get through the API is the Position.ID
Even in the Result record it is only the Position.ID of the original order. Is there not some unique identifier for the trade operation?
2. In the Desktop there is an ID and an OrderID to each operation, but I can't match it with the Position.IDs of my automatic trades?
The desktop ID and OderID of trades seem unique, opposite to the cBot IDs.
How can I match my cBot Results with any TradeReports I generate from my desktop?
Cheers
GridSurfer
Replies
GridSurfer
20 Jul 2020, 18:07
Hi Panagiotis,
thanks, I got it corrected already.
I am using ExecuteMarketOrderAsync(), ClosePositionAsync() and ModifyPositionAsync() and catch the event with the TradeResult.
I assumed that I get the deal / closedDealId with the TradeResult, but I needed to differentiate between Buy/Sell and Close/Modify.
Cheers
GridSurfer
@GridSurfer
PanagiotisCharalampous
20 Jul 2020, 09:08
Hi GridTrader,
You need to be more specific with the terminology you use. There are no "trades" or "trade operations" in cTrader so I am not sure to what are you referring to. In cTrader there are orders, positions and deals, each one with its own unique identifier. For a better explanation of the domain model check this article. If you are looking for the deal IDs through the API, check History and HistoricalTrade.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous