Get Close Trades By Login
GetCloseTradesByLogin¶
Retrieves all closed trades for a given account login.
int GetCloseTradesByLogin(int login, std::vector<TradeRecord>* trades);
Parameters¶
- login — integer representing the account login ID.
- trades — pointer to a
std::vectorof TradeRecord structures where the retrieved closed trades will be stored.
Return Value¶
RET_OK— closed trades found and successfully retrieved.RET_NOT_FOUND— no closed trades found for the specified login.RET_*— other error codes.- Return Codes
Example¶
std::vector<TradeRecord> closedTrades;
if (GetCloseTradesByLogin(1001, &closedTrades) == RET_OK) {
// Process closedTrades
}
Warning
- The
tradespointer must point to a validstd::vector<TradeRecord>object. - If no closed trades are found, the function will return
RET_NOT_FOUNDand leavetradesunchanged. - Always check the return code before accessing
trades.