class O2GAccountTableRow

Parents
O2GAccountRow

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 O2GTableManager. An O2GTableManager object must have the O2GTableManagerStatus.TABLES_LOADED 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 O2GAccountsTable class. For example,

O2GAccountsTable accountsTable = (O2GAccountsTable)tableManager.getTable(O2GTableType.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 O2GAccountsTable class:

O2GAccountsTable method

Syntax example

getRow

O2GAccountTableRow account = accountsTable.getRow(i);

findRow

O2GAccountTableRow account = accountsTable.findRow(mAccountID);

getNextRow

O2GAccountTableRow account = accountsTable.getNextRow(mIterator);

getNextRowByColumnValue

O2GAccountTableRow account = accountsTable.getNextRowByColumnValue("AccountKind", mAccountKind, mIterator);

getNextRowByColumnValues

O2GAccountTableRow account = accountsTable.getNextRowByColumnValues("AccountKind", new Object[] { "32", "36" }, mIterator);

getNextRowByMultiColumnValues

O2GAccountTableRow account = accountsTable.getNextRowByMultiColumnValues(new String[] { "AccountKind", "MarginCallFlag" }, new Object[] { "32", "N" }, mIterator);

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 individually. 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]

The namespace is com.fxcore2.

Public Methods

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 a cell of the table.

getColumns

Gets the columns of the table.

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 that defines 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 the 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 of the account.

getUsedMargin3

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

isCellChanged

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

back