Skip to content

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::vector of 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 trades pointer must point to a valid std::vector<TradeRecord> object.
  • If no closed trades are found, the function will return RET_NOT_FOUND and leave trades unchanged.
  • Always check the return code before accessing trades.