Skip to content

BalanceIn

Adds a deposit transaction to the specified trading account.

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

Parameters

  • login — account login ID to which the deposit will be applied.
  • amount — deposit amount. Must be greater than or equal to zero.
  • comment — text comment for the transaction (e.g., reason for deposit).

Return Value

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

Example

int result = BalanceIn(1001, 250.0, "Initial deposit");
if (result == RET_OK) {
    // Deposit added successfully
}

Warning

  • The amount must be non-negative; otherwise, the method returns RET_ERR_PARAMS.
  • This method does not validate account existence — ensure the login is correct before calling.
  • The underlying call SetBalance may return additional system-level errors — always handle the return code.

Information

The BalanceIn method is part of the ScaleTrade Plugin API, designed to allow plugins to perform deposit financial operations on trading accounts.

Target keywords:
- ScaleTrade deposit API
- BalanceIn trading platform
- add funds to account C++
- trading plugin financial operations
- SetBalance OP_BALANCE_IN
- account deposit transaction

Useful for:
- Finance automation plugins
- CRM–platform integrations
- Automated deposit modules
- Payment gateway connectors