Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimization not working for AddPeriod(variable)

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

    Optimization not working for AddPeriod(variable)

    I am doing some optimization where I have an AddPeriod(X), logic handling using BarsInProgress == 1 (the AddPeriod Bars), and then trying to optimize what X should be.

    However, the results returned in the Optimization study are nearly identical regardless of input for the AddPeriod, vs. they change quite a bit when run manually inputting it via BackTesting.

    Thus, my question - is AddPeriod(myInputTime) actually supported within the optimizer such that it will truly run a clean init test for each AddPeriod input?

    Because AddPeriod is set at Initialization, the strategy optimizer would have to reinit the strategy for each test run..and that does not appear to be happening. However, I have so many variables going that I can't definitively say that and don't want to write a dummy strategy just to verify...

    If someone from NT would clarify, as well as advise if this will be supported in NT7 if its not working now, I would greatly appreciate it.

    Thanks

    #2
    SIFTrader, correct this is unfortunately not supported - in NinjaTrader 7 you can directly optimize the input time series's granularity so there would be no need to add a series for this purpose -

    Comment


      #3
      Thanks Bertrand. I see that you can optimize on a primary time series in NT7 thanks to your link.

      However, will optimizing on multiple time frames be supported?

      Example: 2 MA crossovers, created with AddPeriod. I want to optimize the combination of timeframe X for fast average, and timeframe Y for slow. (i.e. it might test 5-10 for fast, and 20-30 for slow, and find that the optimal was 7 fast, 25 slow).

      The link just says you could optimize on what time chart for the entire chart (i.e. 2MA with fixed time inputs on a variable underlying chart), but not necessarily the above scenario of each indicators input being variable and optimizable.

      Thanks as always for your help.

      Comment


        #4
        SIFTrader, unfortunately not - you can optimize the base timeframe the strategy runs on. I believe you could optimize a second MA for example by introducing a multiplication factor of the smaller timeframe...i.e. a 100 bar SMA on a 1min frame will be very close to the 5 min timeframes 20 bar MA value...

        Comment


          #5
          Thanks for the info Bertrand.

          Being able to optimize on a base time frame will be an improvement, maybe they can add the multi-time frame optimization in a 7.x upgrade.

          Comment


            #6
            You're welcome, I agree and will make sure to forward your suggestion - thanks

            Comment


              #7
              HI
              nt6.5 ignore the AddPeriod(X),
              i think you can try :

              AddPeriod(1),
              AddPeriod(2),
              AddPeriod(3),
              AddPeriod(4),

              then set the varibe in :
              BarsInProgress == (x)

              where x=1 To 4 while opimize

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X