Get Close Trade By Gateway UUID
GetCloseTradeByGwUUID¶
Retrieves a closed trade by its gateway UUID.
int GetCloseTradeByGwUUID(const std::string& gw_uuid, TradeRecord* trade);
Parameters¶
- gw_uuid — string representing the external gateway UUID of the trade.
- trade — pointer to a TradeRecord structure where the retrieved trade details will be stored.
Return Value¶
RET_OK— trade found and successfully retrieved.RET_NOT_FOUND— no closed trade found with the specified gateway UUID.RET_*— other error codes.- Return Codes
Example¶
TradeRecord tr;
if (GetCloseTradeByGwUUID("gw-uuid-123", &tr) == RET_OK) {
// Process trade data
}
Warning
- The
tradepointer must point to a valid, pre-allocatedTradeRecordstructure. - If no closed trade is found, the function returns
RET_NOT_FOUNDand leavestradeunchanged. - Always check the return code before using the
tradedata.