class O2GTradeRow

Parents
O2GRow

Brief

The class provides access to open position information.

Details

An instance of the class can be obtained by the following methods:

Method/Use

Prerequisites

O2GTradesTableResponseReader.getRow

This method is used to get the initial open position information after a session with the trading server is established.
This method provides access to a single open position. If you have multiple open positions, call this method in a loop.

Depending on the trading server settings, the Trades table may or may not be loaded by the server automatically during a login process.

To determine whether the table is loaded or not and what follow-up action is required to get the open position information, use the returned value of the O2GLoginRules.isTableLoadedByDefault method:

Both the methods use the O2GResponse object of the O2GResponseType.GET_TRADES type.
You must parse this object by using the O2GTradesTableResponseReader object.

For details, see the example below.

O2GTablesUpdatesReader.getTradeRow

This method is used to get open position information updates.
This method provides access to a single open position. If you have multiple open positions, call this method in a loop.

To receive the open position information updates, you must implement the IO2GResponseListener.onTablesUpdates method. The received O2GResponse object is of the O2GResponseType.TABLES_UPDATES type.
You must parse this object by using the O2GTablesUpdatesReader object.

For details, see the example below.

Example

Get Trade ID, Offer ID and Amount [show]

The derived class is O2GTradeTableRow.
The namespace is com.fxcore2.

Public Methods

getAccountID

Gets the unique identification number of the account the position is opened on.

getAccountKind

Gets the type of the account the position is opened on.

getAccountName

Gets the unique name of the account the position is opened on.

getAmount

Gets the amount of the position.

getBuySell

Gets the trade operation the position is opened by.

getCell

Gets a cell of the table.

getColumns

Gets the columns of the table.

getCommission

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.

getOfferID

Gets the unique identification number of the instrument traded.

getOpenOrderID

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

getOpenOrderReqID

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

getOpenOrderRequestTXT

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

getOpenQuoteID

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

getOpenRate

Gets the price the position is opened at.

getOpenTime

Gets the date and time when the position is opened.

getParties

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

getRolloverInterest

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

getTableType

Gets the type of the table.

getTradeID

Gets the unique identification number of the open position.

getTradeIDOrigin

Gets the unique identification number of the position, the partial closing of which has resulted in the opening of the current position.

getUsedMargin

Gets the amount of funds currently committed to maintain the position.

getValueDate

Gets the simulated delivery date.

isCellChanged

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

back