Get All Open Trades
GetAllOpenTrades¶
Retrieves all currently open trades from the system.
int GetAllOpenTrades(std::vector<TradeRecord>* trades);
Parameters¶
- trades — pointer to a
std::vectorof TradeRecord structures where the retrieved open trades will be stored.
Return Value¶
RET_OK— open trades found and successfully retrieved.RET_NOT_FOUND— no open trades found in the system.RET_*— other error codes.- Return Codes
Example¶
std::vector<TradeRecord> openTrades;
if (GetAllOpenTrades(&openTrades) == RET_OK) {
// Process openTrades
}
Warning
- The
tradespointer must point to a validstd::vector<TradeRecord>object. - If no open trades are found, the function will return
RET_NOT_FOUNDand leavetradesunchanged. - Always check the return code before accessing
trades.