public method IO2GClosedTradesTable.getNextRowByColumnValues
Brief
Gets the next row from IO2GClosedTradesTable
based on any of the column values.
Declaration | ||||
|
Parameters | |
columnName |
The name of a column in the Closed Trades table. For example, |
valueCount |
Number of values of the column. |
columnValues |
The values of the column specified by the |
iterator |
The table iterator. |
row |
[out] The row fetched. |
Details
This method allows finding all rows that contain any of the specified column values.
If the row is not found, the method returns false
.
Example
Get closed positions by accounts 12345
and 23456
from the Trades table [hide]
O2G2Ptr<IO2GClosedTradesTable> closedTradesTable = (IO2GClosedTradesTable *)tableManager->getTable(ClosedTrades); bool found = false; IO2GTableIterator iterator; IO2GClosedTradeTableRow *closedTrade = NULL; const void *columnValues[] = {(void *)"12345", (void *)"23456"}; while (closedTradesTable->getNextRowByColumnValues("AccountID", 2, columnValues, iterator, closedTrade)) { found = true; std::cout << "TradeID: " << closedTrade->getTradeID() << " OfferID = " << closedTrade->getOfferID() << " Amount = " << closedTrade->getAmount() << std::endl; closedTrade->release(); } if (!found) std::cout << "You don't have any closed positions by specified accounts.");
Note: The returned row contains the current column values. The values are not automatically updated. To monitor
changes, use IO2GTableListener.onChanged
.
The row interface is thread-safe. The returned row can be used in different threads without synchronization.
Declared in IO2GClosedTradesTable