class O2GSummaryTableRow

Parents
O2GSummaryRow

Brief

The class provides access to the summary information of the instrument traded.

Details

The class represents a single row of the Summary table. The class provides methods to access summarized information, such as buy/sell gross and net profits/losses, average open prices, amounts of long and short positions, etc.

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 O2GSummaryTable class. For example,

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

Instantiating the class

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

O2GSummaryTable method

Syntax example

getRow

O2GSummaryTableRow summary = summaryTable.getRow(i);

findRow

O2GSummaryTableRow summary;
bool bFound = summaryTable.findRow(mOfferID, out summary);

getNextRow

O2GSummaryTableRow summary;
bool bFound = summaryTable.getNextRow(mIterator, out summary);

getNextRowByColumnValue

O2GSummaryTableRow summary;
bool bFound = summaryTable.getNextRowByColumnValue("OfferID", "1", mIterator, out summary);

getNextRowByColumnValues

O2GSummaryTableRow summary;
bool bFound = summaryTable.getNextRowByColumnValues("OfferID", new object[] { "1", "2" }, mIterator, out summary);

getNextRowByMultiColumnValues

O2GSummaryTableRow summary;
bool bFound = summaryTable.getNextRowByMultiColumnValues(new string[] { "OfferID", "Amount" }, new object[] { mOfferID, mAmount }, mIterator, out summary);

If you want to track the Summary 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 for 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

summaryTable.subscribeUpdate(O2GTableUpdateType.Insert, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.Insert, tableListener);

onChanged

summaryTable.subscribeUpdate(O2GTableUpdateType.Update, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.Update, tableListener);

onDeleted

summaryTable.subscribeUpdate(O2GTableUpdateType.Delete, tableListener);

summaryTable.unsubscribeUpdate(O2GTableUpdateType.Delete, tableListener);

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

O2GSummaryTableRow row = (O2GSummaryTableRow)(rowData);

Example

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

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

Public Properties

Amount

Gets the amount of all positions (both long and short).

BuyAmount

Gets the amount of long (buy) positions.

BuyAvgOpen

Gets the average open price of long (buy) positions.

BuyClose

Gets the current market price, at which short (sell) positions can be closed.

BuyNetPL

Gets the current profit/loss of all long (buy) positions.

Columns

The columns of the table.

DefaultSortOrder

Gets the sequence number of the instrument.

GrossPL

Gets the current profit/loss of all positions (both long and short). It does not include commissions and interests.

Instrument

Gets the symbol of the traded instrument. For example, EUR/USD, USD/JPY, GBP/USD.

NetPL

Gets the current profit/loss of all positions (both long and short). It includes commissions and interests.

OfferID

Gets the unique identification number of the traded instrument.

SellAmount

Gets the amount of short (sell) positions.

SellAvgOpen

Gets the average open price of short (sell) positions.

SellClose

Gets the current market price, at which long (buy) positions can be closed.

SellNetPL

Gets the current profit/loss of all short (sell) positions.

TableType

The type of the table.

Public Methods

getCell

Gets a cell of the table.

isCellChanged

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

back