class IO2GTradeTableRow
Parents | |
IO2GTradeRow |
Brief
The class provides access to the open position information and calculated fields.
Details
The class represents a single row of the Trades table. In addition to the methods of its parent class,
the O2GTradeTableRow
class provides methods to access calculated fields, such as
current profit/loss for a position, current profit/loss per one lot, prices of associated stop/limit orders, and current close price.
Prerequisites
The class is available only through the use of the IO2GTableManager
. An 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 IO2GTradesTable
class. For example,
O2GTradesTable tradesTable = (O2GTradesTable)tableManager.getTable(O2GTable::Trades);
Instantiating the class
If you need access to the current trade information, get an instance of the class by calling any of the following methods of the
IO2GTradesTable
class:
|
Syntax example |
|
|
|
|
|
|
|
|
|
|
|
If you want to track the 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 subscription/unsubscription syntax are listed below.
|
Subscribe syntax |
Unsubscribe syntax |
|
|
|
|
|
|
|
|
To instantiate the O2GTradeTableRow
class, you must cast the rowData
parameter of the methods above to the O2GTradeTableRow
type. For example,
O2GTradeTableRow row = (O2GTradeTableRow)(rowData);
Example
Get Trade ID, current close price and gross profit/loss [show]
Public Methods | |
Gets the columns of the table. |
|
Gets the unique identification number of the account the position is opened on. |
|
Gets the type of the account the position is opened on. |
|
Gets the unique name of the account the position is opened on. |
|
Gets the amount of the position. |
|
Gets the trade operation the position is opened by. |
|
Gets value of a table cell. |
|
Gets the price at which a position can be closed at the moment. |
|
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. |
|
Gets the current profit/loss of a position. |
|
Gets the price of the associated limit order (profit limit level). |
|
Gets the unique identification number of the traded instrument. |
|
Gets the unique identification number of the order the position is opened by. |
|
Gets the identifier of the order request the position is opened by. |
|
Gets the custom identifier of the order the position is opened by. |
|
Gets the unique identifier of the pair of prices (bid and ask) the position is opened at. |
|
Gets the price the position is opened at. |
|
Gets the date and time when the position is opened. |
|
Gets the unique identifier of the environment that has been used to open the position. |
|
Gets the current profit/loss per one lot of a position. |
|
Gets the cumulative amount of funds that is added to the account balance for holding the position opened overnight. |
|
Gets the price of an associated stop order (loss limit level). |
|
Gets the type of the table. |
|
Gets the unique identification number of the open position. |
|
Gets the unique identification number of the position partial closing of which results in opening of the current position. |
|
Gets the amount of funds currently committed to maintain the position. |
|
Gets the simulated delivery date. |
|
Gets a flag indicating whether the value of the cell is changed. |