{"id":8076,"date":"2025-09-04T23:21:57","date_gmt":"2025-09-05T04:21:57","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=8076"},"modified":"2025-09-04T23:23:51","modified_gmt":"2025-09-05T04:23:51","slug":"subscribing-to-initialization-events","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-net-sdk\/working-with-orders-and-fills-tt-net-sdk\/handling-trade-subscriptions\/subscribing-to-initialization-events\/","title":{"rendered":"Subscribing to initialization events"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"about-initialization-events\">About initialization events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;object is essentially a collection of pointers to a set of orders and a collection of pointers to a set of fills. Before calling the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html#tt_net_sdk_TradeSubscription_Start\">Start()<\/a>&nbsp;method for a&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;object, these collections are empty. After calling the Start method, the TT .NET SDK begins to populate these collections.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"supported-initialization-events\"><a href=\"\/tt-net-sdk\/articles\/of-initialization-events.html#supported-initialization-events\"><\/a>Supported initialization events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;object fires the following event when its initial set of orders and fills are added.<\/p>\n\n\n<?xml encoding=\"utf-8\" ?><figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Event<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html#tt_net_sdk_TradeSubscription_OrderBookDownload\">OrderBookDownload<\/a><\/td><td>Fired when the order book download is complete and the orders have been added to the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;instance<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After this event has fired, the application can begin to perform actions on the orders associated with a&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;instance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"subscribing-for-initialization-events\"><a href=\"\/tt-net-sdk\/articles\/of-initialization-events.html#subscribing-for-initialization-events\"><\/a>Subscribing for initialization events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can subscribe for initialization events as follows before calling the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html#tt_net_sdk_TradeSubscription_Start\">Start()<\/a>&nbsp;method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Create a TradeSubscription to listen for initialization events\nm_ts = new TradeSubscription(tt_net_sdk.Dispatcher.Current);\nm_ts.OrderBookDownload += new EventHandler&lt;OrderBookDownloadEventArgs&gt;(m_ts_OrderBookDownload);\nm_ts.Start();\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"defining-event-handlers\"><a href=\"\/tt-net-sdk\/articles\/of-initialization-events.html#defining-event-handlers\"><\/a>Defining event handlers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following code snippet shows the structure for these event handlers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void m_ts_OrderBookDownload(object sender, OrderBookDownloadEventArgs e)\n{\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>About initialization events A&nbsp;TradeSubscription&nbsp;object is essentially a collection of pointers to a  [&hellip;]<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-net-sdk","meta":{"_acf_changed":true,"footnotes":""},"docs-category":[779],"class_list":["post-8076","doc","type-doc","status-publish","hentry","docs-category-handling-trade-subscriptions"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8076","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":0,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8076\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=8076"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=8076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}