public method IO2GClosedTradesTable.getNextRowByMultiColumnValues
Brief
Gets the next row from IO2GClosedTradesTable
based on the multiple columns values.
Declaration | ||||
|
Parameters | |
columnCount |
Number of columns in which the search is to be performed. |
columnNames |
The array of column names in the Closed Trades table. |
columnValues |
The array of values of the column specified by the |
iterator |
The table iterator. |
row |
[out] The row fetched. |
Details
If the row is not found, the method returns false
.
Example
Get closed positions by specified AccountID
and OfferID
from the ClosedTrades table [hide]
O2G2Ptr<IO2GClosedTradesTable> closedTradesTable = (IO2GClosedTradesTable *)tableManager->getTable(ClosedTrades); bool found = false; IO2GTableIterator iterator; IO2GClosedTradeTableRow *closedTrade = NULL; const char *columnNames[] = {"AccountID", "OfferID"}; const void *columnValues[] = {(void *)"12345", (void *)"1"}; while (closedTradesTable->getNextRowByMultiColumnValues(2, columnNames, columnValues, iterator, closedTrade)) { found = true; std::cout << "TradeID: " << closedTrade->getTradeID() << " OfferID = " << closedTrade->getOfferID() << " Amount = " << closedTrade->getAmount() << std::endl; closedTrade->release(); } if (!found) std::cout << "No closed positions found.");
Note: The returned row contains the current columns 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