class O2GClosedTradeTableRow

Parents
O2GClosedTradeRow

Brief

The class provides access to the closed position information.

Details

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

The class represents a single row of the Closed Trades table.

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

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

Instantiating the class

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

O2GClosedTradesTable method

Syntax example

getRow

O2GClosedTradeTableRow closedTrade = closedTradesTable.getRow(i);

findRow

O2GClosedTradeTableRow closedTrade;
bool bFound = closedTradesTable.findRow(mTradeID, out closedTrade);

getNextRow

O2GClosedTradeTableRow closedTrade;
bool bFound = closedTradesTable.getNextRow(mIterator, out closedTrade);

getNextRowByColumnValue

O2GClosedTradeTableRow closedTrade;
bool bFound = closedTradesTable.getNextRowByColumnValue("OfferID", mOfferID, mIterator, out closedTrade);

getNextRowByColumnValues

O2GClosedTradeTableRow closedTrade;
bool bFound = closedTradesTable.getNextRowByColumnValues("AccountID", new object[] { "12345", "23456" }, mIterator, out closedTrade);

getNextRowByMultiColumnValues

O2GClosedTradeTableRow closedTrade;
bool bFound = closedTradesTable.getNextRowByMultiColumnValues(new string[] { "AccountID", "OfferID" }, new object[] { mAccountID, mOfferID }, mIterator, out closedTrade);

If you want to track the Closed Trades 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

closedTradesTable.subscribeUpdate(O2GTableUpdateType.Insert, tableListener);

closedTradesTable.unsubscribeUpdate(O2GTableUpdate Type.INSERT, tableListener);

onChanged

closedTradesTable.subscribeUpdate(O2GTableUpdateType.Update, tableListener);

closedTradesTable.unsubscribeUpdate(O2GTableUpdateType.Update, tableListener);

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

O2GClosedTradeTableRow row = (O2GClosedTradeTableRow)(rowData);

Example

Get Trade ID, close rate and gross profit/loss [show]

Public Properties

AccountID

Gets the unique identification number of the position account.

AccountKind

Gets the type of the position account.

AccountName

Gets the unique name of the position account.

Amount

Gets the amount of a closed position.

BuySell

Gets the trade operation the position is opened by.

CloseOrderID

Gets the unique identification number of the order the position is closed by.

CloseOrderParties

Gets the unique identifier of the environment that has been used to close the position.

CloseOrderReqID

Gets the unique identifier of the order request the position is closed by.

CloseOrderRequestTXT

Gets the custom identifier of the order the position is closed by.

CloseQuoteID

Gets the unique identifier of the pair of prices (bid and ask) the position is closed at.

CloseRate

Gets the price the position is closed at.

CloseTime

Gets the date and time when the position is closed.

Columns

The columns of the table.

Commission

Gets the amount of funds subtracted from the account balance to pay for the broker's service in accordance with the terms and conditions of the account trading agreement.

GrossPL

Gets the profit/loss of the position.

OfferID

Gets the unique identification number of a traded instrument.

OpenOrderID

Gets the unique identification number of the order the position is opened by.

OpenOrderParties

Gets the unique identifier of the environment that has been used to open the position.

OpenOrderReqID

Gets the unique identifier of the order request the position is opened by.

OpenOrderRequestTXT

Gets the custom identifier of the order the position is opened by.

OpenQuoteID

Gets the unique identifier of the pair of prices (bid and ask) the position is opened at.

OpenRate

Gets the price the position is opened at.

OpenTime

Gets the date and time when the position is opened.

PL

Gets the current profit/loss per one lot of a position.

RolloverInterest

Gets the cumulative amount of funds added to the account balance for holding a position opened overnight.

TableType

The type of the table.

TradeID

Gets the unique identification number of the position.

TradeIDOrigin

Gets the unique identification number of the position a partial closing of which results in opening of the current position.

TradeIDRemain

Gets the unique identification number of the position opened as a result of the partial closing of the current position.

ValueDate

Gets the simulated delivery date.

Public Methods

getCell

Gets a cell of the table.

isCellChanged

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

back