-
Notifications
You must be signed in to change notification settings - Fork 17
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
Returns balance value of the current account in the account currency.
protected double AccountBalance()
- Balance value of the current account (the amount of money on the account)
double balance = AccountBalance();
Print ("balance=" + balance.ToString("F2"));
result in Alveo Log:
balance=10025.06.
Returns credit value of the current account.
protected double AccountCredit()
- Credit value of the current account.
Returns the brokerage company name where the current account was registered.
protected string AccountCompany()
- The brokerage company name where the current account was registered.
Returns currency name of the current account.
protected string AccountCurrency()
- Currency name of the current account.
Returns equity value of the current account.
protected double AccountEquity()
- Equity value of the current account.
Returns free margin value of the current account.
protected double AccountFreeMargin()
- Free margin value of the current account.
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)
- symbol - Symbol for trading operation.
- cmd - Operation type. It can be either OP_BUY or OP_SELL.
- volume - Number of lots.
- Free margin that remains after the specified order has been opened at the current price on the current account.
Returns the calculation mode of free margin allowed to open orders on the current account.
protected double AccountFreeMarginMode()
- 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.
Returns leverage of the current account.
protected int AccountLeverage()
- Leverage of the current account.
Returns margin value of the current account.
protected double AccountMargin()
- Margin value of the current account.
Returns the current account name.
protected string AccountName()
- Name of the current account.
Returns the current account number.
protected int AccountNumber()
- The current account number.
Returns profit value of the current account.
protected double AccountProfit()
- Profit value of the current account.
Returns the value of the Stop Out level.
protected int AccountStopoutLevel()
- The value of the Stop Out level.
Returns the calculation mode for the Stop Out level.
protected int AccountStopoutMode()
- 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.