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.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 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;
bool bFound = accountsTable.findRow(mAccountID, out account);

getNextRow

O2GAccountTableRow account;
bool bFound = AccountsTable.getNextRow(mIterator, out account);

getNextRowByColumnValue

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

getNextRowByColumnValues

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

getNextRowByMultiColumnValues

O2GAccountTableRow account;
bool bFound = accountsTable.getNextRowByMultiColumnValues(new string[] { "AccountKind", "MarginCallFlag" }, new object[] { "32", "N" }, mIterator, out 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 the 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 above methods to the O2GAccountTableRow type. For example,

O2GAccountTableRow row = (O2GAccountTableRow)(rowData);

Example

Get Account ID, Equity and Usable margin [show]

The type defined in the fxcore2.dll assembly. The namespace is fxcore2.

Public Properties

AccountID

Gets the unique identification number of the account.

AccountKind

Gets the type of the account.

AccountName

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

AmountLimit

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

Balance

Gets the amount of funds on the account.

BaseUnitSize

Gets the size of one lot.

Columns

The columns of the table.

DayPL

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

Equity

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

GrossPL

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

LastMarginCallDate

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

LeverageProfileID

Gets the unique identification number of an account leverage profile that specifies margin requirements.

M2MEquity

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

MaintenanceFlag

Gets a rollover maintenance flag.

MaintenanceType

Gets the type of a position maintenance.

ManagerAccountID

Gets the unique identification number of the funds manager account.

MarginCallFlag

Gets the limitation state of the account.

NonTradeEquity

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

TableType

The type of the table.

UsableMargin

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

UsedMargin

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

UsedMargin3

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

Public Methods

getCell

Gets a cell of the table.

isCellChanged

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

back