class O2GTradeTableRow
Parents | |
|
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 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 O2GTradesTable
class. For example,
O2GTradesTable tradesTable = (O2GTradesTable)tableManager.getTable(O2GTableType.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
O2GTradesTable
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 the subscription/unsubscription syntax are listed below.
|
Subscribe syntax |
Unsubscribe syntax |
|
|
|
|
|
|
|
|
To instantiate the O2GTradeTableRow
class, you must cast the rowData
parameter of the above methods to the O2GTradeTableRow
type. For example,
O2GTradeTableRow row = (O2GTradeTableRow)(rowData);
Example
Get Trade ID, current close price and gross profit/loss [show]
The type defined in the fxcore2.dll
assembly.
The namespace is fxcore2
.
Public Properties | |
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 the price at which a position can be closed at the moment. |
|
The columns of the table. |
|
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 an associated limit order (profit limit level). |
|
Gets the unique identification number of the instrument traded. |
|
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). |
|
The type of the table. |
|
Gets the unique identification number of the open position. |
|
Gets the unique identification number of the position, the partial closing of which has resulted in the opening of the current position. |
|
Gets the amount of funds currently committed to maintain the position. |
|
Gets the simulated delivery date. |
Public Methods | |
Gets a cell of the table. |
|
Gets a flag indicating whether the value of the cell is changed. |