{"id":8089,"date":"2025-09-04T23:21:46","date_gmt":"2025-09-05T04:21:46","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=8089"},"modified":"2025-09-04T23:23:49","modified_gmt":"2025-09-05T04:23:49","slug":"trade-subscription-behavior-on-disconnect","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-net-sdk\/working-with-trade-subscriptions\/trade-subscription-behavior-on-disconnect\/","title":{"rendered":"Trade Subscription Behavior on Disconnect"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"default-behavior-on-disconnect\">Default Behavior on Disconnect<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;class only provides information on real time events. During a disconnect, the SDK stops receiving all real time order events. Once reconnected, the SDK simply syncs its order book by adding and deleting orders to match the current state of the TT order book.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SDK does not have information on events that occurred during the disconnection (e.g., orders being triggered, changed, filled, or cancelled). Therefore, the SDK cannot replay these events when connectivity is reestablished.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.FillsSubscription.html\">FillsSubscription<\/a>&nbsp;class can provide access to fills that occurred during a disconnect since they provide access to historical fills.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cancel-on-disconnect-functionality\"><a href=\"\/tt-net-sdk\/articles\/trd-disconnects.html#cancel-on-disconnect-functionality\"><\/a>Cancel-On-Disconnect Functionality<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The TT .NET SDK provides the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html#tt_net_sdk_TradeSubscription_CancelOrderViaREST_tt_net_sdk_OrderProfile_\">CancelOrderViaREST(OrderProfile)<\/a>&nbsp;method as an alternate way to cancel orders after the application disconnects from the system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using this method, the application can cancel the working orders via a REST API call. Successfully cancelling an order triggers an\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderDeletedEventArgs.html\">OrderDeleted<\/a>\u00a0event. Unsuccessfully cancelling an order, triggers an\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderRejectedEventArgs.html\">OrderRejected<\/a>\u00a0event.<\/p>\n\n\n\n<div class=\"wp-block-twentytwentyfive-child-tt-callout component-callout callout-info\"><span class=\"badge \">Note<\/span>\n<p class=\"wp-block-paragraph\">This is a synchronous call and only supports cancelling one order at a time. Batch cancellation of orders is not supported.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-twentytwentyfive-child-tt-callout component-callout callout-warning\"><span class=\"badge \">Warning<\/span>\n<p class=\"wp-block-paragraph\">Application disconnects due to network or other connectivity issues may result in the cancel-on-disconnect request to also fail. TT strongly recommends taking this restriction into account when coding your application.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<h2 class=\"wp-block-heading\" id=\"default-behavior-on-disconnect\">Default Behavior on Disconnect<\/h2>\n<p class=\"wp-block-paragraph\">The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;class only provides information on real time events. During a disconnect, the SDK stops receiving all real time order events. Once reconnected, the SDK simply syncs its order book by adding and deleting orders to match the current state of the TT order book.<\/p>\n<p class=\"wp-block-paragraph\">The SDK does not have information on events that occurred during the disconnection (e.g., orders being triggered, changed, filled, or cancelled). Therefore, the SDK cannot replay these events when connectivity is reestablished.<\/p>\n<p class=\"wp-block-paragraph\">The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.FillsSubscription.html\">FillsSubscription<\/a>&nbsp;class can provide access to fills that occurred during a disconnect since they provide access to historical fills.<\/p>\n<h2 class=\"wp-block-heading\" id=\"cancel-on-disconnect-functionality\"><a href=\"\/tt-net-sdk\/articles\/trd-disconnects.html#cancel-on-disconnect-functionality\"><\/a>Cancel-On-Disconnect Functionality<\/h2>\n<p class=\"wp-block-paragraph\">The TT .NET SDK provides the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html#tt_net_sdk_TradeSubscription_CancelOrderViaREST_tt_net_sdk_OrderProfile_\">CancelOrderViaREST(OrderProfile)<\/a>&nbsp;method as an alternate way to cancel orders after the application disconnects from the system.<\/p>\n<p class=\"wp-block-paragraph\">Using this method, the application can cancel the working orders via a REST API call. Successfully cancelling an order triggers an\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderDeletedEventArgs.html\">OrderDeleted<\/a>\u00a0event. Unsuccessfully cancelling an order, triggers an\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderRejectedEventArgs.html\">OrderRejected<\/a>\u00a0event.<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-net-sdk","meta":{"_acf_changed":true,"footnotes":""},"docs-category":[774],"class_list":["post-8089","doc","type-doc","status-publish","hentry","docs-category-working-with-trade-subscriptions"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8089","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\/8089\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=8089"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=8089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}