For efficiency reasons, TT Core SDK does not hold fills in memory. If you need to access past fills, you:
-
Create a class that is derived from
ttsdk::IFillDownloadCallbackHandlerPtr and defines your
event handler. You must provide implementations for:
-
virtual void OnDownloadComplete(const DownloadResult
code, HistoricalFillCollectionPtr orders, const char*
message) = 0;
- Callback fired when the fill download is completed
-
virtual void OnDownloadComplete(const DownloadResult
code, HistoricalFillCollectionPtr orders, const char*
message) = 0;
- Call the DownloadFills() function passing your event handler instance variable and other query parameters.
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 GetCount(); i++)
{
FillPtr fill = fills->GetFill(i);
ExecutionReportPtr er = fill->GetExecutionReport();
std::cout GetOrderId()
GetCumQty()