Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

speed questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    speed questions

    Hi NT experts,

    Will TraceOrders and Print commands in a strategy slow down a strategy's processing?

    #2
    Yes. After debugging your strategy you should remove those.

    Comment


      #3
      Use C# precompile directives

      You should use C# precompile directives to compile in debug code when you are developling your strategies and to remove them from the compiled code when deploying your strategy for real time production use.

      Example:

      Add this to the first line of your strategy:

      #define DEBUG

      then around your Print() calls throuhg out your strategy wrap the Print and Trace calls with:

      #if DEBUG
      Print("Here is some debug output");
      #endif


      Then when your compiling for real time production use:

      change the #define DEBUG at the top of your strategy to:

      #undef DEBUG

      Saves a lot of time having to comment and uncomment your debug code


      Comment


        #4
        Great advice. Thanks for pointing that out.

        Comment


          #5
          Great thanks. Saved a lot of time.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Kaledus, Today, 01:29 PM
          0 responses
          3 views
          0 likes
          Last Post Kaledus
          by Kaledus
           
          Started by PaulMohn, Today, 12:36 PM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          37 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by rdtdale, Today, 01:02 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          3 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X