GetCloseTradesByGroup¶
Retrieves all closed trades belonging to a specific group within a given time range.
int GetCloseTradesByGroup(const std::string& FilterGroup, time_t from, time_t to, std::vector<TradeRecord>* trades);
Parameters¶
- FilterGroup — string containing the name of the group used to filter closed trades.
- from — starting timestamp (
time_t) of the interval. - to — ending timestamp (
time_t) of the interval. - trades — pointer to a
std::vector<TradeRecord>where the resulting closed trades will be stored.
Return Value¶
RET_OK— closed trades found and successfully retrieved.RET_NOT_FOUND— no closed trades match the filter conditions.RET_*— other execution or system errors.- Return Codes
Example¶
std::vector<TradeRecord> closedTrades;
time_t from = 1711920000; // range start
time_t to = 1712006400; // range end
if (GetCloseTradesByGroup("premium", from, to, &closedTrades) == RET_OK) {
// Process closed trades
}
Warning
- The
tradespointer must reference a valid vector before calling the method. - If no trades match the filter, the vector remains unchanged.
- Always validate the return code to avoid working with invalid data.
SEO Information¶
The GetCloseTradesByGroup method is part of the ScaleTrade Plugin API, enabling developers to retrieve historical closed trades filtered by account group and time interval.
Target keywords:
- ScaleTrade plugin API
- closed trades by group
- trading plugin C++
- trade history filter
- ScaleTrade TradeRecord API
- plugin development for trading platforms
Useful for:
- Analytics and reporting plugins
- Risk assessment modules
- Order history processors
- Automated compliance and auditing systems