For efficiency reasons, TT Core SDK does not hold fills in memory. If you need to access past fills, you:
The following code snippet demonstrates an example of this process.
class FillObserver : public ttsdk::IFillDownloadCallbackHandlerPtr
{
public:
FillObserver() {}
virtual void OnDownloadComplete(const DownloadResult code,
HistoricalFillCollectionPtr fills, const char* message)
{
if (code == DownloadResult.SUCCESS)
{
for (size_t i = 0; i < fills->GetCount(); i++)
{
FillPtr fill = fills->GetFill(i);
ExecutionReportPtr er = fill->GetExecutionReport();
std::cout << “Order ID = “ << er->GetOrderId()
<< “ Cumulative Fill Qty = “ << er->GetCumQty()
<< std::endl;
}
}
else
{
std::cout << "Fill download request failed -- “ << message << std::endl;
}
}
};
FillObserver fillObserver;
void foo()
{
// …
const uint64_t accountId = 12345;
bool result = ttsdk::DownloadFills(fillObserver, accountId);
// ...
}