class IO2GAccountTableRow

Parents
IO2GAccountRow

Brief

The class provides access to the account information and calculated fields.

Details

The class represents a single row of the Accounts table. In addition to the methods of its parent class, the O2GAccountTableRow class provides methods to access calculated fields, such as daily profit/loss, equity, gross profit/loss, and usable margin.

Prerequisites

The class is available only through the use of the IO2GTableManager. An IO2GTableManager object must have the O2GTableManagerStatus.TablesLoaded status.
For complete instructions on the table manager usage, see the How to use table manager in ForexConnect API section.
After tables are loaded, you must obtain an instance of the IO2GAccountsTable class. For example,

O2GAccountsTable accountsTable = (O2GAccountsTable)tableManager.getTable(O2GTable::Accounts);

Instantiating the class

If you need access to the current account information, get an instance of the class by calling any of the following methods of the IO2GAccountsTable class:

IO2GAccountsTable method

Syntax example

getRow

IO2GAccountTableRow *account = accountsTable->getRow(i);

findRow

IO2GAccountTableRow *account = NULL;
bool bFound = accountsTable->findRow(mAccountID, account);

getNextRow

IO2GAccountTableRow *account = NULL;
bool bFound = accountsTable->getNextRow(mIterator, account);

getNextRowByColumnValue

IO2GAccountTableRow *account = NULL;
bool bFound = accountsTable->getNextRowByColumnValue("AccountKind", (void *)mAccountKind, mIterator, account);

getNextRowByColumnValues

IO2GAccountTableRow *account = NULL;
const void *values[] = {(void *)"32", (void *)"36"};
bool bFound = accountsTable->getNextRowByColumnValues("AccountKind", 2, values, mIterator, account);

getNextRowByMultiColumnValues

IO2GAccountTableRow *account = NULL;
const char *names[] = {"AccountKind", "MarginCallFlag"};
const void *values[] = {(void *)"32", (void *)"N"};
bool bFound = accountsTable->getNextRowByMultiColumnValues(2, names, values, mIterator, account);

If you want to track the Accounts table updates, your application must have a listener class that implements the IO2GTableListener interface. An instance of the listener class must be subscribed to the table updates. Subscription to each update type is done individually. Before the logout, you must unsubscribe the listener from each update type separately. The examples of subscription/unsubscription syntax are listed below.

IO2GTableListener method

Subscribe syntax

Unsubscribe syntax

onAdded

accountsTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

accountsTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

onChanged

accountsTable.subscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

accountsTable.unsubscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

To instantiate the O2GAccountTableRow class, cast the rowData parameter of the methods above to the O2GAccountTableRow type. For example,

O2GAccountTableRow row = (O2GAccountTableRow)(rowData);

Example

Get Account ID, Equity and Usable margin [show]

Public Methods

columns

Gets the columns of the table.

getAccountID

Gets the unique identification number of the account.

getAccountKind

Gets the type of the account.

getAccountName

Gets the unique name of the account as it is displayed in the FX Trading Station.

getAmountLimit

Gets the maximum amount of an order that is allowed on the account.

getBalance

Gets the amount of funds on the account.

getBaseUnitSize

Gets the size of one lot.

getCell

Gets value of a table cell.

getDayPL

Gets the amount of the profits and losses (both floating and realized) of the current trading day.

getEquity

Gets the amount of funds on the account, including profits and losses of all open positions (the floating balance of the account).

getGrossPL

Gets the amount of profits and losses of all open positions on the account.

getLastMarginCallDate

Gets the date and time of the last occurrence of a Margin Call.

getLeverageProfileID

Gets the unique identification number of an account leverage profile which defines the margin requirements.

getM2MEquity

Gets the equity balance of the account at the beginning of a trading day.

getMaintenanceFlag

Gets a rollover maintenance flag.

getMaintenanceType

Gets the type of a position maintenance.

getManagerAccountID

Gets the unique identification number of the funds manager account.

getMarginCallFlag

Gets the limitation state of the account.

getNonTradeEquity

Gets the amount of accounting transactions that is applied to the account during the current trading day.

getTableType

Gets the type of the table.

getUsableMargin

Gets the amount of funds available to open new positions or to absorb losses of the existing positions.

getUsedMargin

Gets the amount of funds used to maintain all open positions on the account.

getUsedMargin3

Gets the amount of funds used to maintain all open positions on the account with the three-level margin policy.

isCellChanged

Gets a flag indicating whether the value of the cell is changed.

back