{"id":7025,"date":"2025-08-28T22:11:59","date_gmt":"2025-08-29T03:11:59","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=7025"},"modified":"2026-06-29T13:31:24","modified_gmt":"2026-06-29T18:31:24","slug":"downloading-fills-2","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-core-sdk\/working-with-orders-and-fills\/downloading-fills-2\/","title":{"rendered":"Downloading Fills"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For efficiency reasons, TT Core SDK does not hold fills in memory. If you need to access past fills, you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a class that is derived from ttsdk::IFillDownloadCallbackHandlerPtr and defines your event handler. You must provide implementations for:\n<ul class=\"wp-block-list\">\n<li>virtual void OnDownloadComplete(const DownloadResult code, HistoricalFillCollectionPtr orders, const char* message) = 0;\n<ul class=\"wp-block-list\">\n<li>Callback fired when the fill download is completed<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Call the DownloadFills() function passing your event handler instance variable and other query parameters.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The following code snippet demonstrates an example of this process.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\nclass FillObserver : public ttsdk::IFillDownloadCallbackHandlerPtr\n{\n  public:\n    \tFillObserver() {}\n\n    \tvirtual void OnDownloadComplete(const DownloadResult code,\n                      HistoricalFillCollectionPtr fills, const char* message)\n\t    {\n\t\t          if (code == DownloadResult.SUCCESS)\n              {\n                    for (size_t i = 0; i &lt; fills-&gt;GetCount(); i++)\n                    {\n                            FillPtr fill = fills-&gt;GetFill(i);\n                            ExecutionReportPtr er = fill-&gt;GetExecutionReport();\n                            std::cout &lt;&lt; \u201cOrder ID = \u201c &lt;&lt; er-&gt;GetOrderId()\n                                  &lt;&lt; \u201c Cumulative Fill Qty = \u201c &lt;&lt; er-&gt;GetCumQty()\n                                  &lt;&lt; std::endl;\n                    }\n              }\n              else\n              {\n                    std::cout &lt;&lt; \"Fill download request failed -- \u201c &lt;&lt; message &lt;&lt; std::endl;\n              }\n\t    }\n};\n\nFillObserver fillObserver;\n\nvoid foo()\n{\n        \/\/ \u2026\n\n        const uint64_t accountId = 12345;\n        bool result = ttsdk::DownloadFills(fillObserver, accountId);\n\n        \/\/ ...\n}\n\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p class=\"wp-block-paragraph\">For efficiency reasons, TT Core SDK does not hold fills in memory. If you need to access past fills, you:<\/p>\n<p class=\"wp-block-paragraph\">The following code snippet demonstrates an example of this process.<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-core-sdk","meta":{"_acf_changed":false,"footnotes":""},"docs-category":[448],"class_list":["post-7025","doc","type-doc","status-publish","hentry","docs-category-working-with-orders-and-fills"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":2,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7025\/revisions"}],"predecessor-version":[{"id":59690,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7025\/revisions\/59690"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=7025"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=7025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}