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

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.
    Chris L.NinjaTrader Customer Service

    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 dward123, 01-02-2024, 09:59 PM
          3 responses
          159 views
          0 likes
          Last Post bjunaid
          by bjunaid
           
          Started by ETFVoyageur, Today, 04:00 PM
          1 response
          7 views
          0 likes
          Last Post ETFVoyageur  
          Started by AaronKTradingForum, Today, 03:44 PM
          1 response
          8 views
          0 likes
          Last Post AaronKTradingForum  
          Started by Felix Reichert, 04-26-2024, 02:12 PM
          11 responses
          77 views
          0 likes
          Last Post Felix Reichert  
          Started by junkone, 04-28-2024, 02:19 PM
          7 responses
          83 views
          1 like
          Last Post junkone
          by junkone
           
          Working...
          X