class O2GTradesTableResponseReader
Parents | |
|
Brief
The class reads a stream of open position rows coming from the trading server.
Details
All data from the trading server come in the form of responses. The type of the response depends on the type of the request.
An O2GResponse
object of the type GET_TRADES
comes from the trading server as a response to the request for initial open position information.
The response consists of the Trades table rows. Every row is represented by an
O2GTradeRow
object.
In order to read this response you must use the O2GTradesTableResponseReader
.
Getting the response
If your application uses the O2GTableManager
, the Trades table is always loaded during the login process.
This information is kept in an O2GTradesTable
object.
If your application does not use the O2GTableManager
, the initial open position information needs to be requested.
Depending on the trading server settings, the Trades table may or may not be loaded by the server automatically during the login process.
To determine whether the table is loaded or not and what follow-up action is required to obtain the
GET_TRADES
response,
use the returned value of the O2GLoginRules
.isTableLoadedByDefault
method
with the O2GTableType.TRADES argument:
Returned Value |
Follow-up action |
|
Call the
|
|
Create a request to get initial open position information by using the
In this case, an instance of the |
Instantiating the class
After receiving the GET_TRADES
response, an instance of the
O2GTradesTableResponseReader
class can be obtained by calling the
O2GResponseReaderFactory
.createTradesTableReader
method.
For example:
O2GResponseReaderFactory responseFactory = session.getResponseReaderFactory();
O2GTradesTableResponseReader tradesReader = responseFactory.createTradesTableReader(tradesResponse);
Example
Get Trade ID, Offer ID and Amount [show]
The namespace is com.fxcore2
.
Public Methods | |
Gets the value of a cell. |
|
Gets an instance of the class that provides access to the list of table columns. |
|
Gets a row by its index. |
|
Gets a row from the Trades table. |
|
Gets the type of a trading table. |
|
Checks whether the cell value can be used or not. |
|
Gets the number of rows in the reader. |