{"id":8080,"date":"2025-09-04T23:21:48","date_gmt":"2025-09-05T04:21:48","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=8080"},"modified":"2025-09-04T23:23:50","modified_gmt":"2025-09-05T04:23:50","slug":"modifying-orders-2","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-net-sdk\/working-with-orders-and-fills-tt-net-sdk\/modifying-orders-2\/","title":{"rendered":"Modifying orders"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To modify an existing order, you create a new&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfileBase.html\">OrderProfileBase<\/a>&nbsp;object based on the existing&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;by calling the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html#tt_net_sdk_Order_GetOrderProfile\">GetOrderProfile()<\/a>&nbsp;method from the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;object. The new&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;profile object contains the same property values as the existing&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>. You can modify any properties of the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;profile object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After making the desired changes, set the value of the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderProfile.Action<\/a>&nbsp;property to indicate how the existing order should be modified, as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To delete the existing order, set the value to\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Delete<\/a>.<\/li>\n\n\n\n<li>To place the existing order on hold, set the value to<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Hold<\/a>\u00a0to resubmit a held order, set the value to\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Resubmit<\/a>.<\/li>\n\n\n\n<li>To modify the existing order values, set the value to\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Change<\/a>.<br><strong>Note: <\/strong>Some exchanges do not support a Change request for an Order. In these cases, the TT system accepts a Change request and converts it to a Cancel\/Replace request before sending it to the exchange.<\/li>\n\n\n\n<li>To cancel the existing Order and replace it with a new\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>\u00a0based on the new\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>\u00a0profile, set the value to\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Replace<\/a>.<\/li>\n\n\n\n<li>To update only the UserTag and UserData properties of the existing\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>, set the value to\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html#tt_net_sdk_OrderProfile_Action\">OrderAction.Update<\/a>.<br><strong>Note: <\/strong>These properties are stored internally in the TT system and broadcast throughout the TT environment, but they are not sent to the Exchange.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The following code snippet demonstrates how to change the price of an order with a given key assuming that a&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.TradeSubscription.html\">TradeSubscription<\/a>&nbsp;object named&nbsp;<code>m_ts<\/code>&nbsp;has already been created.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void changeOrderPrice(string key, Price p)\n{\n  if (m_ts.Orders.ContainsKey(key))\n  {\n    Order order = m_ts.Orders&#91;key];\n    OrderProfile op  = order.GetOrderProfile();\n    op.LimitPrice = p;\n    op.Action = OrderAction.Change;\n\n    if (!m_ts.SendOrder(op))\n    {\n      Console.WriteLine(\"Send change order Failed.\");\n    }\n    else\n    {\n      Console.WriteLine(\"Sent order change request.\u201d);\n    }\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-an-existing-order-as-a-template-for-a-new-order\"><a href=\"\/tt-net-sdk\/articles\/of-modifying-orders.html#using-an-existing-order-as-a-template-for-a-new-order\"><\/a>Using an existing order as a template for a new order<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In addition to creating a new&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html\">OrderProfile<\/a>&nbsp;profile from an existing&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;so you can modify the order, you can also create a new&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.OrderProfile.html\">OrderProfile<\/a>&nbsp;profile object to use as a template for a new order. The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html#tt_net_sdk_Order_CreateNewOrderProfile\">Order.CreateNewOrderProfile()<\/a>&nbsp;method creates an&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;profile object with the same properties as the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>&nbsp;object; however, you can use it only to submit a new&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-twentytwentyfive-child-tt-callout component-callout callout-info\">\n<p class=\"wp-block-paragraph\"><strong>Note: <\/strong>The\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html#tt_net_sdk_Order_CreateNewOrderProfile\">Order.CreateNewOrderProfile()<\/a>\u00a0method does not modify the original\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>; it only uses the details of the original\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>\u00a0as the basis for a new\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Order.html\">Order<\/a>.<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To modify an existing order, you create a new&nbsp;OrderProfileBase&nbsp;object based on the existing&nbsp;Ord [&hellip;]<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-net-sdk","meta":{"_acf_changed":true,"footnotes":""},"docs-category":[773],"class_list":["post-8080","doc","type-doc","status-publish","hentry","docs-category-working-with-orders-and-fills-tt-net-sdk"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8080","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\/8080\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=8080"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=8080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}