Skip to content

CreditIn

Adds a credit transaction to the specified trading account.

int CreditIn(int login, double amount, const std::string& comment);

Parameters

  • login — account login ID receiving the credit.
  • amount — credit amount. Must be greater than or equal to zero.
  • comment — description or reason for the credit operation.

Return Value

  • RET_OK — credit operation successfully recorded.
  • RET_ERR_PARAMS — invalid parameters (e.g., negative amount).
  • Other RET_* — error codes returned by SetCredit.
  • Return Codes

Example

int result = CreditIn(1001, 200.0, "Bonus credit");
if (result == RET_OK) {
    // Credit added successfully
}

Warning

  • The amount must be non-negative, otherwise the method returns RET_ERR_PARAMS.
  • This method does not verify whether the account exists — ensure the login is valid.
  • The underlying SetCredit call may return additional system-level errors — always check the return code.

Information

The CreditIn method is part of the ScaleTrade Plugin API, enabling plugins to apply credit operations to trading accounts.

Target keywords:
- ScaleTrade credit API
- trading platform credit operation
- C++ plugin financial operations
- OP_CREDIT_IN
- add credit to trading account
- SetCredit ScaleTrade

Useful for:
- Bonus and incentive systems
- CRM platform integrations
- Automated crediting modules
- Financial adjustment tools