{"id":508,"date":"2017-02-22T03:18:01","date_gmt":"2017-02-22T03:18:01","guid":{"rendered":"http:\/\/www.patternsmart.com\/cn\/?p=508"},"modified":"2017-02-22T03:18:01","modified_gmt":"2017-02-22T03:18:01","slug":"debugging-the-behavior-of-your-orders-in-ninjatrader-nt7","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/debugging-the-behavior-of-your-orders-in-ninjatrader-nt7\/","title":{"rendered":"debugging the behavior of your orders in Ninjatrader NT7"},"content":{"rendered":"<p>Sometimes the orders are not working as we expect. So we need to track them to see what&#8217;s going on there.<\/p>\n<p><a href=\"http:\/\/www.ninjatrader.com\/support\/helpGuides\/nt8\/en-us\/traceorders.htm?zoom_highlightsub=traceorders\" target=\"_blank\">TraceOrders<\/a> is a useful property when debugging the behavior of your orders. With the use of this property, you can track orders placed, amended, and cancelled. The traces displayed in the NinjaScript Output window or if used, in the OnOrderTrace Override in the script where this was set. This will provide meaningful information for diagnosis when NinjaTrader ignores, changes or cancels orders when various strategy order methods are called.<\/p>\n<p>Examples<\/p>\n<div>protected override void Initialize()<br \/>\n{<br \/>\nTraceOrders = true;<br \/>\n}<\/div>\n<p>The output will reference a method &#8220;PlaceOrder()&#8221; which is an internal method that all Enter() and Exit() methods use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes the orders are not working as we expect. So w [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[89],"tags":[174],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-ninjatrader","tag-ninjascript"],"_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":1,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/508\/revisions\/509"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}