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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    115 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    161 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    83 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    127 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    81 views
    0 likes
    Last Post PaulMohn  
    Working...
    X