Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer loses template values when moving from backtest to optimization

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

    Strategy Analyzer loses template values when moving from backtest to optimization

    I'm working with a custom strategy as a base. From there, different strategy templates are loaded to tweak values for different charts being used - eg 4 min, 5 min, etc. Issue is with Strategy Analyzer. If I load a strategy template into Analyzer in Backtest mode, all is well. All values appear. But as soon as I change setting to Optimization, some of the values revert to underlying base strategy values, overwriting the template values that were just there. If I switch back to backtest, voila proper values appear again. Also, in the analyzer if I choose the Display dropdown and pick settings from the dropdown list, the proper values appear. It's like the template values are being confused with the base strategy somewhere within NT xml files (this is my WAG, no basis in fact). Thoughts on how to get NT aligned again?

    #2
    Hello cshox,

    Thanks for your post.

    Are you able to reproduce this behavior when testing the SampleMACrossOver strategy that comes default with NinjaTrader?

    Please test to reproduce the behavior using the SampleMACrossOver strategy. If you see the same behavior happen, send me the exact steps you took to reproduce the behavior

    And, please send me screenshots demonstrating the template values being correct when Backtesting and incorrect when changing to Optimization in the Strategy Analyzer.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    I look forward to further assisting.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi Brandon,
      SampleMA works fine, as does the base strategy I'm working with. The issue happens when strategy templates are loaded. Below is an actual case. First pic is backtest, second is optimization. Notice contracts and target ticks. With other templates, other values will be changed. This template was created through a "save as" process. I duplicated a chart, loaded a strategy and template, changed some values, then saved the template with a new name. It's almost likes there is residual data from, or a residual reference to, the original template lingering in the xml or something when template is accessed through Strategy Analyser. But that's for much smarter minds like yourself to determine. Appreciate your help!

      Clint

      Click image for larger version

Name:	image.png
Views:	183
Size:	78.6 KB
ID:	1216547Click image for larger version

Name:	image.png
Views:	120
Size:	95.8 KB
ID:	1216548​​

      Comment


        #4
        Hello cshox,

        Thanks for your note.

        I am not able to reproduce the behavior you are reporting when creating a Strategy Analyzer template for the SampleMACrossOver strategy that comes default with NinjaTrader, loading the template in the Strategy Analyzer, and changing Backtest Type from 'Backtest' to 'Optimization'.

        See this video demonstrating the test I performed and the results: https://brandonh-ninjatrader.tinytak...MV8yMDI0NjE5MA

        Please set the Backtest Type field to 'Backtest', set the Strategy field to 'Sample MA cross over', change the Fast and Slow strategy properties, save the properties as a Strategy Analyzer Template. Change the Strategy filed to another strategy and back to the SampleMACrossOver strategy and load the template you just saved as seen in the demonstration video. After loading the template, change the Backtest Type field to 'Optimization' and note the results. These steps can be seen in the video linked above.

        Let me know if I may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        77 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        45 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        27 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X