class O2GClosedTradesTable

Parents
O2GTable

Brief

The class keeps in memory the up-to-date information about positions closed during the current trading day.

Details

The class is an in-memory representation of the Closed Trades 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 individual closed positions represented by the O2GClosedTradeTableRow.

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.

Instantiating the class

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

O2GClosedTradesTable closedTradesTable = (O2GClosedTradesTable)tableManager.getTable(O2GTableType.ClosedTrades);

Receiving notifications about the Closed Trades table updates

In order to keep the O2GClosedTradesTable data current, your application must listen to the Closed Trades table updates coming from the trading server. These updates represent inserts into the table and changes of the closed position information. 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 O2GClosedTradesTable:

Update type

Subscribe syntax

Unsubscribe syntax

Insert

closedTradesTable.subscribeUpdate(O2GTableUpdateType.Insert, tableListener);

closedTradesTable.unsubscribeUpdate(O2GTableUpdateType.Insert, tableListener);

Update

closedTradesTable.subscribeUpdate(O2GTableUpdateType.Update, tableListener);

closedTradesTable.unsubscribeUpdate(O2GTableUpdateType.Update, tableListener);

Note: Closed positions cannot be deleted during the trading session. Therefore, you do not receive an update of the Delete type during the trading session and there is no need to subscribe to it.

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

Public Properties

Columns

Gets an instance of the class that provides access to the list of table columns.

Count

Gets the number of rows in the reader.

Type

Gets the type of a trading table.

Public Methods

findRow

Finds a row in the O2GClosedTradesTable by a TradeID.

forEachRow

Iterates through the rows of the table and raises event EachRow.

forEachRow

Iterates through the rows of the table and call RowDelegate on each row.

getCell

Gets the value of a cell.

getGenericRow

Gets a generic row by its index.

getNextGenericRow

Gets the next row from O2GTable.

getNextGenericRowByColumnValue

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

getNextGenericRowByColumnValues

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

getNextGenericRowByMultiColumnValues

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

getNextRow

Gets the next row from the O2GClosedTradesTable.

getNextRowByColumnValue

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

getNextRowByColumnValues

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

getNextRowByMultiColumnValues

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

getRow

Gets a row from the O2GClosedTradesTable by its index.

getStatus

Gets the status of the table.

isCellChanged

Checks whether the cell is changed.

isCellValid

Checks whether the cell value can be used or not.

subscribeStatus

Subscribes table listener to changes of table status.

subscribeUpdate

Subscribes table listener to table updates.

unsubscribeStatus

Unsubscribes table listener from changes of table status.

unsubscribeUpdate

Unsubscribes table listener from table updates.

Events

RowAdded

The event is fired when a new row appears in the table.

RowChanged

The event is fired when a row is changed.

RowDeleted

The event is fired when a row is deleted.

StatusChanged

The event is fired when the table's status changes.

back