class IO2GOrderTableRow

Parents
IO2GOrderRow

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 IO2GTableManager. The IO2GTableManager 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 IO2GOrdersTable class. For example,

O2GOrdersTable ordersTable = (O2GOrdersTable)tableManager.getTable(O2GTable::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 IO2GOrdersTable class:

IO2GOrdersTable method

Syntax example

getRow

IO2GOrderTableRow *order = ordersTable->getRow(i);

findRow

IO2GOrderTableRow *order = NULL;
bool bFound = ordersTable->findRow(mOrderID, order);

getNextRow

IO2GOrderTableRow *order = NULL;
bool bFound = ordersTable->getNextRow(mIterator, order);

getNextRowByColumnValue

IO2GOrderTableRow *order = NULL;
bool bFound = ordersTable->getNextRowByColumnValue("RequestID", (void *)mRequestID, mIterator, order);

getNextRowByColumnValues

IO2GOrderTableRow *order = NULL;
const void *values[] = {(void *)"L", (void *)"S"};
bool bFound = ordersTable->getNextRowByColumnValues("Type", 2, values, mIterator, order);

getNextRowByMultiColumnValues

IO2GOrderTableRow *order = NULL;
const char *names[] = {"RequestID", "Type"};
const void *values[] = {(void *)mRequestID, (void *)mType};
bool bFound = ordersTable->getNextRowByMultiColumnValues(2, names, values, mIterator, order);

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 separately. 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 above methods to the O2GOrderTableRow type. For example,

O2GOrderTableRow row = (O2GOrderTableRow)(rowData);

Example

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

Public Methods

columns

Gets the columns of the table.

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 value of a table cell.

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 the 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 an 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 the associated stop order (the loss limit level).

getStopTrailRate

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

getStopTrailStep

Gets the trailing step of the associated trailing stop order or 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