Skip to content
Don Baechtel edited this page Sep 20, 2018 · 10 revisions

Account API

The Account API provides access to several different account options. Account name, number, profit, etc.

AccountBalance
AccountCredit
AccountCompany
AccountCurrency
AccountEquity
AccountFreeMagin
AccountFreeMarginCheck
AccountFreeMarginMode
AccountLeverage
AccountMargin
AccountName
AccountNumber
AccountProfit
AccountStopoutLevel
AccountStopoutMode

AccountBalance

Returns balance value of the current account in the account currency.

protected double AccountBalance()

Returns

  • Balance value of the current account (the amount of money on the account)

Example

double balance = AccountBalance();
Print ("balance=" + balance.ToString("F2"));

result in Alveo Log:
balance=10025.06.

AccountCredit

Returns credit value of the current account.

protected double AccountCredit()

Returns

  • Credit value of the current account.

AccountCompany

Returns the brokerage company name where the current account was registered.

protected string AccountCompany()

Returns

  • The brokerage company name where the current account was registered.

AccountCurrency

Returns currency name of the current account.

protected string AccountCurrency()

Returns

  • Currency name of the current account.

AccountEquity

Returns equity value of the current account.

protected double AccountEquity()

Returns

  • Equity value of the current account.

AccountFreeMargin

Returns free margin value of the current account.

protected double AccountFreeMargin()

Returns

  • Free margin value of the current account.

AccountFreeMarginCheck

Returns free margin that remains after the specified order has been opened at the current price on the current account.

protected double AccountFreeMarginCheck(string symbol, int cmd, double volume)

Parameters

  • symbol - Symbol for trading operation.
  • cmd - Operation type. It can be either OP_BUY or OP_SELL.
  • volume - Number of lots.

Returns

  • Free margin that remains after the specified order has been opened at the current price on the current account.

AccountFreeMarginMode

Returns the calculation mode of free margin allowed to open orders on the current account.

protected double AccountFreeMarginMode()

Returns

  • Calculation mode of free margin allowed to opened orders on the current account.
  • The calculation mode can take the following values:
    • 0 - floating profit/loss is not used for calculation;
    • 1 - both floating profit and loss on opened orders on the current account are used for free margin calculation;
    • 2 - only profit value is used for calculation, the current loss on opened orders is not considered;
    • 3 - only loss value is used for calculation, the current loss on opened orders is not considered.

AccountLeverage

Returns leverage of the current account.

protected int AccountLeverage()

Returns

  • Leverage of the current account.

AccountMargin

Returns margin value of the current account.

protected double AccountMargin()

Returns

  • Margin value of the current account.

AccountName

Returns the current account name.

protected string AccountName()

Returns

  • Name of the current account.

AccountNumber

Returns the current account number.

protected int AccountNumber()

Returns

  • The current account number.

AccountProfit

Returns profit value of the current account.

protected double AccountProfit()

Returns

  • Profit value of the current account.

AccountStopoutLevel

Returns the value of the Stop Out level.

protected int AccountStopoutLevel()

Returns

  • The value of the Stop Out level.

AccountStopoutMode

Returns the calculation mode for the Stop Out level.

protected int AccountStopoutMode()

Returns

  • Returns the calculation mode for the Stop Out level.
  • Calculation mode can take the following values:
    • 0 - calculation of percentage ratio between margin and equity;
    • 1 - comparison of the free margin level to the absolute value.