{"id":7022,"date":"2025-08-28T22:11:58","date_gmt":"2025-08-29T03:11:58","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=7022"},"modified":"2026-06-29T13:31:15","modified_gmt":"2026-06-29T18:31:15","slug":"submitting-orders","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-core-sdk\/working-with-orders-and-fills\/submitting-orders\/","title":{"rendered":"Submitting Orders"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To submit an order and start receiving order\/fill updates, you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an instance of ttsdk::OrderPtr class and call the ttsdk::CreateOrder() method passing an InstrumentPtr reference that defines the instrument for which you want to submit an order.<\/li>\n\n\n\n<li>If you have derived a class from ttsdk::IOrderEventHandler to receive order \/ fill events for specific solicited orders, call the Subscribe() method of the OrderPtr instance passing an instance of the event handler.<\/li>\n\n\n\n<li>Create an instance of ttsdk::OrderProfile and fill in the order\u2019s parameters.<\/li>\n\n\n\n<li>Call the SendNew() method of the OrderPtr instance passing the OrderProfile instance.<\/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\nttsdk::OrderProfile profile_;\nttsdk::OrderPtr order_;\nOrderObserver orderObs_;\n\nvoid SubmitOrder(ttsdk::InstrumentPtr instrument, double price, double qty)\n{\n    order_ = ttsdk::CreateOrder(instrument);\n    if (!order_)\n    {\n        std::cout &lt;&lt; \"Order creation failed.\" &lt;&lt; std::endl;\n        return;\n    }\n\n    order_-&gt;Subscribe(orderObs_);\n\n    profile_.request_id++;\n    profile_.account_id = 12345;\n    profile_.side = ttsdk::OrderSide::Buy;\n    profile_.price = price\n    profile_.quantity = qty;\n    profile_.type = ttsdk::OrderType::Limit;\n    profile_.tif = ttsdk::TimeInForce::Day;\n    order_-&gt;SendNew(profile_);\n}\n                      \n  \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The OrderProfile class has a member named\u00a0<strong>LeaveOnRestart<\/strong>. It is set to\u00a0<strong>true<\/strong>\u00a0by default. If you are writing a\u00a0<a href=\"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-core-sdk\/creating-a-tt-application-server\/introduction-3\/\" data-type=\"doc\" data-id=\"7027\">TT Application Server<\/a>, setting this to\u00a0<strong>false<\/strong>\u00a0will result in the order being deleted after your application is restarted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"wp-block-paragraph\">To submit an order and start receiving order\/fill updates, you:<\/p>\n<p class=\"wp-block-paragraph\">The following code snippet demonstrates an example of this process.<\/p>\n<p class=\"wp-block-paragraph\">The OrderProfile class has a member named\u00a0<strong>LeaveOnRestart<\/strong>. It is set to\u00a0<strong>true<\/strong>\u00a0by default. If you are writing a\u00a0<a href=\"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-core-sdk\/creating-a-tt-application-server\/introduction-3\/\" data-type=\"doc\" data-id=\"7027\">TT Application Server<\/a>, setting this to\u00a0<strong>false<\/strong>\u00a0will result in the order being deleted after your application is restarted.<\/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-7022","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\/7022","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":3,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7022\/revisions"}],"predecessor-version":[{"id":59688,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/7022\/revisions\/59688"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=7022"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=7022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}