class O2GSummaryTable

Parents
O2GTable

Brief

The class keeps in memory the up-to-date summary information per the instrument traded.

Details

The class is an in-memory representation of the Summary table.
In order to keep this representation in sync with the trading server, you must instantiate the class and listen to the updates coming from the trading server. The class provides methods to find summary for every instrument currently traded, represented by the O2GSummaryTableRow.

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.

Instantiating the class

In order to get summary information for the first time, you must obtain an instance of the class by calling the O2GTableManager.getTable method with the O2GTableType.SUMMARY argument. For example,

O2GSummaryTable summaryTable = (O2GSummaryTable)tableManager.getTable(O2GTableType.SUMMARY);

Receiving notifications about the Summary table updates

In order to keep the O2GSummaryTable data current, your application must listen to the Summary table updates coming from the trading server. These updates represent inserts into the table, changes of the summary information, and deletions from the table. An instance of the class implementing the IO2GTableListener interface must be subscribed to the table updates. Subscription to each update type is done individually. Before the logout, you must unsubscribe the listener from every update type separately. The table below shows the subscription/unsubsription syntax for the O2GSummaryTable:

Update type

Subscribe syntax

Unsubscribe syntax

INSERT

summaryTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

UPDATE

summaryTable.subscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

DELETE

summaryTable.subscribeUpdate(O2GTableUpdateType.DELETE, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.DELETE, tableListener);

Example

Get Offer ID, net profit/loss and amount for the instument traded [show]

The namespace is com.fxcore2.

Public Methods

findRow

Finds a row in the O2GSummaryTable by an OfferID.

getCell

Gets a cell of the table.

getColumns

Gets the columns of the table.

getNextRow

Gets the next row from the O2GSummaryTable.

getNextRowByColumnValue

Gets the next row from O2GSummaryTable based on the column value.

getNextRowByColumnValues

Gets the next row from O2GSummaryTable based on any of the column values.

getNextRowByMultiColumnValues

Gets the next row from O2GSummaryTable based on the multiple columns values.

getRow

Gets a row from the O2GSummaryTable by its index.

getTableType

Gets the type of the table.

isCellChanged

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

back