Get Account Balance
GetAccountBalanceByLogin¶
Retrieves the margin and balance information for a specific account by login.
int GetAccountBalanceByLogin(int login, MarginLevel* margin);
Parameters¶
- login — integer representing the account login ID.
- margin — pointer to a MarginLevel structure where the retrieved margin and balance data will be stored.
Return Value¶
RET_OK— account margin information successfully retrieved.RET_NOT_FOUND— account with the specified login does not exist.RET_*— other error codes.- Return Codes
Example¶
MarginLevel marginInfo;
if (GetAccountBalanceByLogin(1001, &marginInfo) == RET_OK) {
// Use marginInfo data
}
Warning
- The
marginpointer must point to a valid, pre-allocatedMarginLevelstructure. - If the account does not exist or an error occurs, the data in
marginmay be invalid — always check the return code.