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

Combining Walk Forward Test Results

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

    Combining Walk Forward Test Results

    Hello,

    I would like to combine the results of a Walk Forward Optimization into a separate strategy for further analysis. To do this I need to break the out of sample test periods into time segments and use the inputs that were optimized for that period. I did not see where I could do this using the Strategy Builder. Basically I'm trying to create a code that assigns input values if the on bar update is between dates A and B and then assign different values if the on bar update is between dates, C and D, and so on. I was looking for a date function but could not find one. Would appreciate if you could point me in the right direction.

    Thanks,
    ​​​​​​​Ben

    #2
    Hi Ben, thanks for writing in.

    Once the walk forward optimization is finished, you can click on any one of the results at the top, this will load the parameters used to find this best-case scenario for the selected parameters. Once you have selected those, you can right-click the side menu of the strategy analyzer and generate a template that can be loaded at a later time either in the strategy analyzer or when deploying the strategy onto a chart.

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for getting back to me, Chris.

      What I'm trying to do is a little different. My Walkforward Optimization goes back 10 years. I'm using a 4 year optimization period and a 1 year Test period to generate out of sample testing. This produces 6 each one year results a the top of the analyzer. I want to stitch these 6 results together to create a single strategy covering all 6 years. As I understand, your suggestion would create 6 different templates.

      I'm guessing I will need to create a Ninjascript something like this:

      // year 1
      If date > Jan 1 2014 and < Dec 31, 2014
      Optimized Input from previous 4 years = X
      Run strategy

      // year 2
      If date > Jan 1 2015 and < Dec 31, 2015
      Optimized Input from previous 4 years = Y
      Run strategy

      // year 3
      If date > Jan 1 2016 and < Dec 31, 2016
      Optimized Input from previous 4 years = Z
      Run strategy

      and so on for years, 4, 5 and 6

      This would create a single strategy giving me the performance results for 6 out of sample years for further evaluation. Not sure if I'm explaining very well.

      Thanks,
      Ben

      Comment


        #4
        Following up Post #3: How do I code "If date > Jan 1 2014 and < Dec 31, 2014"?

        Comment


          #5
          Hi harr5754, thanks for your reply.

          The walk-forward optimizer is doing this for you automatically. The results displayed at the end of the optimization are only out of sample results. See here for the documentation:

          https://ninjatrader.com/support/help...ForwardResults

          We also have an example of how to make a time filter in the builder here:

          https://ninjatrader.com/support/help...ateTimeFilters

          Best regards,
          -ChrisL
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Thanks Chris,

            I was able to get the combined walk forward test results I wanted to analyze by saving the top line to a new tab. The link for the time filter was also helpful.

            I do have another question. In setting up my optimization and walk forward parameters, I see a check box for commissions but could not find where I could enter a value. Would appreciate if you could tell me where this is.

            Regards,
            Ben

            Comment


              #7
              Hi Ben, thanks for your reply.

              A commission template must be applied to the Sim101 account (Control Center>Accounts tab>right click account>Edit Account>select a template under Commission). You can add and edit commission templates under Tools>Commissions.

              Kind regards,
              -ChrisL
              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by FramiThur, Today, 10:57 PM
              0 responses
              1 view
              0 likes
              Last Post FramiThur  
              Started by HTrader, Today, 09:12 PM
              2 responses
              9 views
              0 likes
              Last Post HTrader
              by HTrader
               
              Started by firstlanetech, Today, 08:56 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by robbersdog, Today, 07:55 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by SuperDude123, Today, 09:08 AM
              2 responses
              42 views
              0 likes
              Last Post SuperDude123  
              Working...
              X