class O2GOrderTableRow

Parents
O2GOrderRow

Brief

The class provides access to the order information and calculated fields.

Details

The class represents a single row of the Orders table. In addition to the methods of its parent class, the O2GOrderTableRow class provides methods to access calculated fields, such as prices of an associated stop/limit order, and trailing rate/step of an associated trailing stop order or a secondary entry stop order of an ELS order.

Prerequisites

The class is available only through the use of the O2GTableManager. The 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.
After tables are loaded, you must obtain an instance of the O2GOrdersTable class. For example,

O2GOrdersTable ordersTable = (O2GOrdersTable)tableManager.getTable(O2GTableType.ORDERS);

Instantiating the class

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

O2GOrdersTable method

Syntax example

getRow

O2GOrderTableRow order = ordersTable.getRow(i);

findRow

O2GOrderTableRow order = ordersTable.findRow(mOrderID);

getNextRow

O2GOrderTableRow order = ordersTable.getNextRow(mIterator);

getNextRowByColumnValue

O2GOrderTableRow order = ordersTable.getNextRowByColumnValue("RequestID", mRequestID, mIterator);

getNextRowByColumnValues

O2GOrderTableRow order = ordersTable.getNextRowByColumnValues("Type", new Object[] { "L", "S" }, mIterator);

getNextRowByMultiColumnValues

O2GOrderTableRow order = ordersTable.getNextRowByMultiColumnValues(new String[] { "RequestID", "Type" }, new Object[] { mRequestID, mType }, mIterator);

If you want to track the Orders 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 individually. The examples of subscription/unsubscription syntax are listed below.

IO2GTableListener method

Subscribe syntax

Unsubscribe syntax

onAdded

ordersTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

ordersTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

onChanged

ordersTable.subscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

ordersTable.unsubscribeUpdate(O2GTableUpdateType.UPDATE, tableListener);

onDeleted

ordersTable.subscribeUpdate(O2GTableUpdateType.DELETE, tableListener);

ordersTable.unsubscribeUpdate(O2GTableUpdateType.DELETE, tableListener);

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

O2GOrderTableRow row = (O2GOrderTableRow)(rowData);

Example

Get Order ID and prices of associated stop/limit orders [show]

The namespace is com.fxcore2.

Public Methods

getAccountID

Gets the unique identification number of the account the order is placed on.

getAccountKind

Gets the type of the account the order is placed from.

getAccountName

Gets the unique name of the account the order is placed on.

getAmount

Gets the amount of the order.

getAtMarket

Gets the distance from the current market price within which the trader allows the order to be executed.

getBuySell

Gets the direction of the trade.

getCell

Gets a cell of the table.

getColumns

Gets the columns of the table.

getContingencyType

Gets the type of the contingent order to which the order is linked.

getContingentOrderID

Gets the unique identification number of the contingent order to which the order is linked.

getExecutionRate

Gets the price the order is executed at.

getExpireDate

Gets the expiration date and time of the order.

getFilledAmount

Gets the amount of the last order portion filled.

getLifetime

Gets the time, during which the trader must accept or reject the order requoted by the dealer.

getLimit

Gets the price of an associated limit order (the profit limit level).

getNetQuantity

Gets the Net Amount order flag.

getOfferID

Gets the unique identification number of the instrument the order is placed for.

getOrderID

Gets the unique identification number of the order.

getOriginAmount

Gets the original amount of the order when it is placed.

getParties

Gets the unique identifier of the environment that is used to place the order.

getPegOffset

Gets the offset to the pegged price.

getPegType

Gets the price used to calculate the pegged order price.

getPrimaryID

Gets the unique identification number of the primary order of the ELS or OTO contingent orders to which the order is linked.

getRate

Gets the price the order is placed at.

getRateMax

Gets the maximum price at which the order can be filled.

getRateMin

Gets the minimum price at which the order can be filled.

getRequestID

Gets the identifier of the request to create the order.

getRequestTXT

Gets the custom identifier of the order.

getStage

Gets the order action.

getStatus

Gets the state of the order.

getStatusTime

Gets the date and time of the last update of the order state.

getStop

Gets the price of an associated stop order (the loss limit level).

getStopTrailRate

Gets the trailing rate of an associated trailing stop order or a secondary entry stop order of an ELS order.

getStopTrailStep

Gets the trailing step of an associated trailing stop order or a secondary entry stop order of an ELS order.

getTableType

Gets the type of the table.

getTimeInForce

Gets the time-in-force option of the order.

getTradeID

Gets the unique identification number of the position to be opened/closed by the order.

getTrailRate

Gets the market price at the time the order automatically moves following the market fluctuations.

getTrailStep

Gets the number of pips the market should move before the order moves the same number of pips after it.

getType

Gets the type of the order.

getValueDate

Gets the simulated delivery date.

getWorkingIndicator

Gets the working indicator flag.

isCellChanged

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

back