Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple "Test Range" question

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

    Simple "Test Range" question

    How do I set a "test range" for a simple optimization? Specifically, how do I set the min, max, and increment? The help file on the topic isn't helping.

    I've right clicked on a symbol, selected optimize, selected a custom strategy, and when I go to any of the strategy input parameters I don't see any place to set min/max/increment. In the SampleMACrossOver strategy I can see the min/max/increment options but I can't figure out how to get this in my custom strategy. Is there something I need to put in the strategy code to allow a step optimization?

    #2
    bluelou, are you able to set the strategy input parameters during backtests? If not, then you will have to make the variables public. I've attached a screenshot of SampleMACrossover with the code necessary to make the 'Fast' variable public. The process is the same for other variable types, so if you had some double value you wished to make public, you would just have to replace 'double' in the code with 'int'.

    In the screenshot, the variable is first declared in line 29 as a private variable (with a lowercase starting letter). Then from lines 61-67, the private variable is exposed as public (with a uppercase starting letter). The capitalization is important. After the variable is made public, you can then use it in your strategy/indicator and optimize it, like in lines 38, 41, 52, and 54.
    Attached Files
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    81 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    46 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 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
    66 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X