Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy development and debugging

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

    Strategy development and debugging

    Hello All,

    Just want to get feedback on what you do to develop and test a strategy. What mean is, what is your iteration in developing and debugging code? I'm asking from the standpoint that you already have the basic code in place and you are using the Playback Connection.

    Let me provide you with what I do:
    1. Code/Update the strategy.
    2. Compile the code. (I'm using Visual Studio because the code completion is really good. I like that NT8 will automatically compile the code when I save the file in VS. I think a NT Script window with the code needs to be open for this.)
    3. On the chart, open the Strategies window.
    4. Remove the strategy I'm working on from the chart and click OK. This is to remove the previous version. I assume this is a necessary step.
    5. Reset the playback timer to the begging (or the desired date). This can take some few moments/minutes.
    6. Add the strategy again and check Enable. Click OK. This is adding the latest version.
    7. Begin playback, monitoring the NT Output Window for my Print statement feedback and any errors.
    8. Repeat 1 through 7 as I find code logic errors or areas of code and/or strategy that need improving
    So, my question, is this the fastest method to do this? Are there any shortcuts? What do you do?

    Thanks,
    Matt


    #2
    Hi Matt, thanks for your post.

    That is essentially what I would do to work out bugs or test a strategy to make sure it's doing what I want it to. If you have a run time error like accessing a null index or something like that, those kind of exceptions can be caught and analyzed using VS debugging:

    https://ninjatrader.com/support/help..._debugging.htm

    Other than this, your testing/debugging technique is pretty standard.

    Please let me know if you have any questions.

    Comment


      #3
      Hi Chris,

      Thank you for the confirmation. Admittedly, the one area that I was seeing if there was a shortcut was the removing and then adding the strategy to a chart. It makes sense that that is the correct approach - unload and then reload the newer version.

      I was aware of the debugging technique with VS. However, I haven't used it and my strategies have not been that complex... yet.

      Thanks again,
      Matt

      Comment


        #4
        Originally posted by StealthM93 View Post
        Hi Chris,

        Thank you for the confirmation. Admittedly, the one area that I was seeing if there was a shortcut was the removing and then adding the strategy to a chart. It makes sense that that is the correct approach - unload and then reload the newer version.

        I was aware of the debugging technique with VS. However, I haven't used it and my strategies have not been that complex... yet.

        Thanks again,
        Matt
        Would hitting F5 work? (F5 reloads the script)

        Comment


          #5
          Originally posted by userque View Post
          Would hitting F5 work? (F5 reloads the script)
          A year later but better late than never, they say... Yes, userque that works! Cuts down on clicks and time. Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X